Skip to content

VEuPathDB/R-local-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R-local-dev

Package for local development of all things R in VEuPathDB.


Quick start - work on one VEuPathDB R Package

Let's say we wanted to work on the veupathUtils package.

  1. Clone the veupathUtils in this directory, so that the final organization looks like
 R-local-dev
  ├──veupathUtils
  ├──Dockerfile
  ├──Makefile
  └── ...
  1. Run make build to build the docker image that contains all packages necessary for development.
  2. Run make start-shell to start an interactive R session within the development container. R should start automatically and the output should end with something like the following
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

>

     Alternatively, to start RStudio run

docker run -d -p 8787:8787 -e PASSWORD=password -v $PWD:/home/rstudio rdev:dev

     This will start an RStudio session. If the browser does not open automatically, navigate to http://localhost:8787/. If you already have RStudio running locally on your machine, you can map a different port, e.g. -p 8888:8787 and access using http://localhost:8888/.

  1. Now we're ready to load our package. The function loadDevPackages will both load the package of interest and install VEuPath dependencies if they exist. If we want to work on veupathUtils, for example, run
loadDevPackages('veupathUtils')
  1. Make changes to the package, reload changes with
load_all('veupathUtils')
  1. Once you're happy with the changes, run all the tests (defined in the tests/testthat folder of any package) using
devtools::test('veupathUtils')

Alternatively, run all the tests in a particular file (for example 'test-correlation.R') using

testthat::test_file('veupathUtils/tests/testthat/test-correlation.R')
  1. All done? Quit using quit().

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •