I have written some functions in R
using S4 classes.
Now I want to build an R
package out of these functions.
How should I proceed? Is there anything that I should do differently because I have used S4 classes?
To get started on a proper R package complete with documentation, the best thing to do is to create a new R project. To do this in Rstudio, go to File > New Project... ; the box below should pop up. Note that we could have started with a project right away, creating a new folder with the New Directory option.
So in conclusion: while R itself is mostly written in C (with hefty chunks in R and Fortran), R packages are mostly written in R (with hefty chunks written in C/C++).
R packages are an ideal way to package and distribute R code and data for re-use by others. The RStudio IDE includes a variety of tools that make developing R packages easier and more productive, including: Build pane with package development commands and a view of build output and errors.
Consult the following reference material:
?package.skeleton
and ?create
in devtools
.useR!2010
on package development.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With