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
This is far from a complete work. Things to consider for improvement:
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()
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.