Manage a collection/library of R source packages. Discover, document, load, test source packages. Enable to use those packages as if they were actually installed. Quickly reload only what is needed on source code change. Run tests and checks in parallel.
The aim of srcpkgs is to make development and use of source packages easy, and thus encourage to continuously develop a shared library of reusable code.
Developing a library of packages can be really tedious, especially if there are dependencies between those packages. Each time you change a package, you have to install it before being able to use it.
The advent of devtools enabled the use of source packages directly, bypassing the installation step, which considerably streamlined the development of ONE package, also making it possible to reload a package within a R session.
srcpkgs extends devtools to manage the development and use of a collection or library of source packages as easily and efficiently as possible.
In particular, it understands the dependencies between those packages and upon changes, determines the optimal
course of action to implement them.
See the vignettes:
The main use case for srcpkgs is for an organization with many R users, that wants to share and reuses code across projects and users. This reusable code will be implemented as a collection of R source packages. The project code itself should also be implemented as a source package.
This way:
The recommended setup is:
This can also be useful for a single developer. This will allow to easily reuse code across projects, avoiding the duplication of code.
N.B: wrapping the code as a source package is for convenience, and is really easy. It's useful even if you have no plan of releasing or distributing the package.
library() and loadNamespace()) to use srcpkgs in development,
so that your scripts still work if you install your packages (e.g. in Production mode)R CMD checking the collectionThe package is now available on CRAN!
Install if from CRAN:
install.packages('srcpkgs')
Install it from github:
### using devtools
# install devtools from CRAN if needed
install.packages('devtools')
install_github('kforner/srcpkgs')
### or using pak
# install pak from CRAN if needed
install.packages('pak')
pak::pak("kforner/srcpkgs")
docker run --rm -ti -v $(pwd):/$(pwd) -w $(pwd) rocker/tidyverse:devel bash
R
library(devtools)
load_all()
check()