README.md

afnistats, a possible alternative for packaging AFNI's R code

This is a a demo of what an "afnistats" packaging would look like. This would help automate testing/dependency management to move towards an improved installation experience across OSes/R versions.

It follows as best it can the guidance of "R packaging". This is helpfully summarized in the Rstudio cheatsheet.

The principle efforts in refactoring the code here are for the purposes of : - establishing compatible with R's packaging infrastructure - adding tests for a basic guarantee of functionality - reducing redundancy by having user inputs, their default values, and their help messages specified in a single location - add basic input validation in an automated manner (check for number of arguments and their type for the various arugments) - make use of R's documentation infrastructure for convenient access from within R - specify dependencies in a standard way - attempt to conform a little better to community styleguides

Work to be done

This is far from a complete work. Things to consider for improvement:

Testing the package out

With docker from the repository directory:

sudo docker run --rm -ti -v $PWD:/home/rstudio/work -e PASSWORD=hello -e ROOT=TRUE -e USERID=`id -u` -p 8787:8787 rocker/tidyverse

Going to a localhost:8787 to access an Rstudio instance and load the afnistats.proj file in the work directory. Follow the standard packaging operations as described in the packaging cheatsheet.

A sensible start would be running the following commands in the R console:

devtools::install_deps(upgrade="never")
devtools::check()

To test versions of R

Circleci is setup to run an installation and some basic checks for every commit to github across differnt versions of R. It is not especially useful but you can run these locally using the local circleci interface. So for example:

circleci local execute --job test_3.6.3



afni/afnistats documentation built on June 13, 2020, 12:22 a.m.