Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to develop a package in R?

Tags:

package

r

s4

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?

like image 694
MYaseen208 Avatar asked Sep 04 '11 04:09

MYaseen208


People also ask

How do you create an R code?

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.

What are R packages written in?

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++).

What is an R package RStudio?

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.


1 Answers

Consult the following reference material:

  1. Chapter 1, Creating R packages, of the Writing R extensions manual. This is the canonical source. It's the ultimate reference point, but not necessarily the best starting point.
  2. A short presentation outlining the key ideas in package development and using the devtools package for development
  3. Hadley's devtools wiki, particular the Package basics section.
  4. The R help for ?package.skeleton and ?create in devtools.
  5. The presentation by Uwe Ligges at useR!2010 on package development.
  6. R Packages by Hadley Wickham.
like image 100
Andrie Avatar answered Sep 23 '22 01:09

Andrie