This package is intended to help analyse and organise your R packages. It is essentially a set of tools to help clean and tidy code and organise the internal functionality of your code. To get started, install from github by running the following script;
library(devtools)
devtools::install_github(
repo = "ntyndall/organisR"
)
library(footballstats)
or, add the above remote to your DESCRIPTION
file.
Assuming that function calls respective to the package you are working on is written as {packagename}::{function_name}
, then this call can figure out a call stack and identify functions that are never called. A vector of entry points must be supplied, i.e. this could be a main function call, or a bunch of scripts. To get started with this, change directory to your R project, cd my-project/
, then from the command line you can run
Rscript -e "organisR::dead(c('demo/*', 'main', 'main2'))"
This will use all the files located in the subdirectory /demo/
, and also the functions defined in /R/
(main
and main2
).
This function creates a binary to be uploaded to github for tagging a release. Just follow the 3 steps below,
- Update DESCRIPTION
file to required version (must be > than most recent GIT
version).
- Run Rscript -e "organisR::tag()"
inside root directory i.e. /packagename/
.
- Update Github with the newest tag that is reported in step 2, and the binary that is produced and saved in /tagged/
.
Activate an interactive script to look and investigate scripts within your package and check its documentation. Just run the following,
Rscript -e "organisR::data()"
Below is a screen grab example of the data sets within dplyr, by supplying the package name to the function call. It reports back on the number of data sets available, their names and other meta data. You can investigate further by reading individual docs on each data set.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.