Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor R package management system and clean up R dependencies #53

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,26 @@ _or_

### R

This project uses `renv` for package management. After cloning the github repository, open the R project and run `renv::restore()` to make sure your packages match. To learn more about how renv works, [see this resource](https://rstudio.github.io/renv/articles/renv.html).
This project uses `renv` for package management. We maintain a libraries.R mini script that calls the necessary packages for the project for local development because renv does not track library calls withing .ipynb files (only.R or .Rmd files).

#### To install the R dependencies:

1. Clone the github repository
2. Open the R project
3. Run `renv::restore()` to make sure your packages match. To learn more about how renv works, [see this resource](https://rstudio.github.io/renv/articles/renv.html).

#### To add new R dependencie:

1. Install the library with `renv::install("package_name")`.
2. Add the package to the libraries.R file so that `renv` can track it (e.g. `library("package_name")`.
3. Run `renv::snapshot()` to update the lockfile.
4. Commit changes and push to github.

### Python

This project uses pip paired with venv to manage dependencies. Note that requirements_dev.txt should be used and updated for local development dependencies, and requirements.txt should be used for production/binder dependencies (updated manually and with discretion).

#### To install the dependencies:
#### To install the python dependencies:

1. Clone the github repository
2. create a virtual environment:
Expand All @@ -111,7 +124,7 @@ This project uses pip paired with venv to manage dependencies. Note that require
**Note** to update your package installations:
`pip install -U -r requirements_dev.txt`

#### To add new packages:
#### To add new python dependencies:

1. Activate the virtual environment:
`source venv/bin/activate`
Expand Down
3 changes: 2 additions & 1 deletion .renvignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.ipynb
*.ipynb
venv/*
9 changes: 9 additions & 0 deletions libraries.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file contains the libraries that are used in the R juptyer notebooks to facilitate reproducibility using the renv package.

library(jsonlite)
library(dplyr)
library(tidyr)
library(ggplot2)
library(forcats)
library(lubridate)
library(GGally)
Loading