Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit

Permalink
Move R config to .Renvrion
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiddelkoop committed May 31, 2024
1 parent 11849a8 commit e82cea9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 33 deletions.
13 changes: 8 additions & 5 deletions Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,15 @@ git config --local --list
* Note: The file must be saved before the option to install is shown.
* Note: The R session may need to be restarted. Do this with
* "Session" -> "Restart R"
* Remember to "Open Project" for theproject when starting a new environment.
* Libraries can be installed with a `Setup.Rmd` file.
* `setup.Rmd` must be run once every time you start a new environment (start a Juypter Lab instance) (this can be different on other systems).
* See [Setup.Rmd](prep/Setup.Rmd) for an example.
* Libraries can be installed with a `setup.R` file.
* `setup.R` must be run once every time you start a new environment (start a Juypter Lab instance) (this can be different on other systems).
* See [Setup.R](prep/Setup.R) for an example.
* Do not include `install.packages()` in your R Markdown files (other than `Setup.Rmd) as the R Markdown file is run every time it is displayed with "Knit" and will re-install the packages every time.
* By default libraries are not saved when restarting the environment.
* By default libraries are not saved when restarting the environment. You can change the save path by creating a `.Renviron` file in the project directory (remember to Restart R) with the following contents:
```bash
R_LIBS_SITE=~/work/R
```
* Remember to "Open Project" for the project when starting a new environment.

## Technical Notes

Expand Down
28 changes: 0 additions & 28 deletions prep/Setup.Rmd

This file was deleted.

8 changes: 8 additions & 0 deletions prep/setup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Setup RStudio
# Run this R script only once in an environment to install packages.

options(repos = list(CRAN="http://cran.rstudio.com/"))

install.packages(c("tidyverse", "lubridate", "ratdat"))
install.packages("ggplot2")
install.packages(c("dbplyr", "RSQLite"))

0 comments on commit e82cea9

Please sign in to comment.