-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved reproducible environments to week 5
- Loading branch information
1 parent
ad07079
commit 2f88684
Showing
4 changed files
with
63 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: ETC4500/ETC5450 Advanced R programming | ||
author: "Week 4: Debugging and performance" | ||
format: | ||
beamer: | ||
pdf-engine: pdflatex | ||
aspectratio: 169 | ||
fontsize: "14pt,t" | ||
section-titles: false | ||
knitr: | ||
opts_chunk: | ||
dev: "cairo_pdf" | ||
fig-width: 7.5 | ||
fig-height: 3.5 | ||
include-in-header: ../header.tex | ||
keep-tex: true | ||
--- | ||
|
||
```{r} | ||
#| label: setup | ||
#| include: false | ||
#| cache: false | ||
source(here::here("setup.R")) | ||
source(here::here("course_info.R")) | ||
``` | ||
|
||
## Outline | ||
|
||
\vspace*{0.4cm} | ||
\tableofcontents | ||
|
||
# Reproducible environments | ||
|
||
## renv package | ||
|
||
![](../diagrams/renv.png) | ||
|
||
## renv package | ||
|
||
* `renv.init()` : initialize a new project with a new environment. Adds: | ||
* `renv/library` contains all packages used in project | ||
* `renv.lock` contains metadata about packages used in project | ||
* `.Rprofile` run every time R starts. | ||
|
||
* `renv.snapshot()` : save the state of the project to `renv.lock`. | ||
|
||
* `renv::restore()` : restore the project to the state saved in `renv.lock`. | ||
|
||
## renv package | ||
\fontsize{14}{16}\sf | ||
|
||
* renv uses a package cache so you are not repeatedly installing the same packages in multiple projects. | ||
* `renv::install()` can install from CRAN, Bioconductor, GitHub, Gitlab, Bitbucket, etc. | ||
* `renv::update()` gets latest versions of all dependencies from wherever they were installed from. | ||
* Only R packages are supported, not system dependencies, and not R itself. | ||
* renv is not a replacement for Docker or Singularity. | ||
* `renv::deactivate(clean = TRUE)` will remove the renv environment. | ||
|
||
## Exercises | ||
|
||
5. Add renv to your Assignment 1 project. Make sure the packages included are the latest CRAN versions of all packages. |