Skip to content

For developers

rburghol edited this page Sep 21, 2018 · 2 revisions

Initial R package creation

  • This was done in Rstudio, but should be similar from linux R command line
  • R package is housed in a sub-directory of this git project. If that proves unwise we can change it later.
  • Following: https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/)
  • Updated to use most recent release version of roxygen2
  • cd into the basic git tree for the R sub-directory of the project
  • copy the classes.R file into the new openmi.om directory t
install.packages("devtools")
library("devtools")
install.packages("roxygen2")
library("roxygen2")
setwd(".\\openmi-om\\R")
# create the openmi.com package directory tree and minimum files
create("openmi.om")
# copy the classes.R file into the new openmi.om directory (done at bash command line or file manager)

Updating package documentation

  • This was done in Rstudio, but should be similar from linux R command line
# go into the R package tree base inside the larger git project
setwd(".\\openmi-om\\R\\openmi.om")
library("devtools")
library("roxygen2")
document()

Create Installable tar.gz File

  • From linux command prompt (bash)
cd openmi-om/R/
R CMD build openmi.om

Clone this wiki locally