MyNixOS website logo
Description

R Source Packages Manager.

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.

srcpkgs

R-CMD-check

Codecov test coverage

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.

Synopsis

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.

srcpkgsextends 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, determine and apply the optimal course of action to apply those changes.

See the vignettes:

intended target

The main use case for srcpkgs is for an organization with many R users, that want to share and reuse 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:

  • each project has it own version of the collection
  • the project devs can easily adapt the collection for their project (add features, fix bugs) in the same R session used for the project
  • at any time, the project devs can push their changes to the collection

The recommended setup is:

  • one git repository for the (interdependent) collection of source packages
    • of course you could have a git repo per source package, but if you have dozends of them it's cumbersome to add them as git sub modules to all your projects. Moreover it's harder to select compatible versions.
  • one git repository for a project
    • with the collection add the the project as a git submodule

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.

Features

  • fast and automatic discovery of the source packages
  • fast and automatic detection of changes: quickly unload/reload/load only what is needed.
  • apply roxygen (cf roxygen2) automatically and only when needed
  • can hack the R loaders (library() and loadNamespace()) to use srcpkgs in development, so that your scripts still work if you install your packages (e.g. in Production mode)
  • extensively tested (~ 450 tests) and 100% test coverage

forthcoming

  • testing the collection at once, in parallel, and output an aggregated report (using testthat of course).
  • same for R CMD checking the collection
  • same for test coverage (using covr).

Installation

The package is not (yet) available on CRAN.

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")
Metadata

Version

0.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows