Skip to content

DataSHIELD Base Client Environment

Notifications You must be signed in to change notification settings

datashield/DSProjectTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataSHIELD Project Client Environment

This R project template uses the renv for setting up a reproducible DataSHIELD client side R environment. This allows to use the appropriate DataSHIELD client R packages, matching the selected server-side DataSHIELD profiles.

The project's R environment includes the following R packages (and their dependencies):

Usage

Clone this Repository

Start by creating your project source code repository from this template: see instructions in Creating a repository from a template. You could also just download this folder, but it is a good practice to have source code in a version control system (Git).

Read the Introduction to renv vignette to learn the basics of R environment management.

Open Project in RStudio

  1. Open this project in Rstudio by selecting the project.Rproj file.
  2. If reported by renv in the R console, run the renv::restore() to install the R packages in their specific version (i.e. as described by the renv.lock file).

Use libPaths() to locate where the R packages are installed.

Adding a new R Package Dependency

  1. Install the R package using install.packages() or using renv::install() which allows to manage R packages installed from an archived version, a GitHub repository, Bioconductor repository or a local package folder
  2. Load the R package in one of your R source code with library() (see R/script.R as an example)
  3. Run renv::snapshot() to register this package as part of your project environment

Removing an R Package Dependency

  1. Edit your R source code and remove the library() load statements of the R package to remove
  2. Run renv::snapshot() to unregister this package from your project environment

Use Git Branches

Different R environments means different package dependencies, and also potentially different R/DataSHIELD analysis code. In order to maintain/develop different environments in parallel, you can use the Git branches. Upgrading to new versions of dependencies will be facilitated. To make a new branch:

  1. Select Git tab and New Branch in Rstudio, or command line git checkout -b branchName
  2. Install/update R packages
  3. Update analysis R script to connect to the appropriate DataSHIELD server profiles and to fix any breaking changes
  4. Run renv::snapshot()
  5. Commit changes in Git using Rstudio or command line

See also the vignette Collaborating with renv.

About

DataSHIELD Base Client Environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages