Makefile generator for R analytical projects
To install rmake, simply issue the following command within your R session:
install.packages("devtools")
library(devtools)
devtools::install_github("beerda/rmake")
The package requires the R_HOME
environment variable to be properly set.
Suppose you have a file dataset.csv
. You want to pre-process it and store the results into dataset.rds
within the preprocess.R
R script. After that, dataset.rds
is then an input file for
report.Rmd
and details.Rmd
, which are R-Markdown scripts that generate report.pdf
and
details.pdf
. The whole project can be initialized with rmake as follows:
make
tool properly installed.dataset.csv
into it.r
library(rmake)
rmakeSkeleton('.')
Makefile.R
and Makefile
will be created.preprocess.R
, report.Rmd
and details.Rmd
.Makefile.R
as follows:
r
library(rmake)
job <- c('dataset.csv' %>>% rRule('preprocess.R') %>>% 'dataset.rds' %>>% markdownRule('report.Rmd') %>>% 'report.pdf',
'dataset.rds' %>>% markdownRule('details.Rmd') %>>% 'details.pdf')
)
makefile(job, 'Makefile')
This will create three build rules: processing of preprocess.R
and execution of report.Rmd
and details.Rmd
in order to generate resulting PDF files.make
or build your project in R Studio (Build/Build all). This will automatically re-generate Makefile
and execute preprocess.R
and the generation of report.Rmd
and details.Rmd
accordingly to the changes
made to source files.Coming soon.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.