Forum:What are the benefits of creating your own R packages?
0
2
Entering edit mode
6.8 years ago
ropolocan ▴ 810

Hello Biostars community,

Two of the things that occupy my mind the most are reproducible research and teaching skills to to others. I have been recently thinking of creating my own R package to distribute and document functions that I wrote. My goal for the immediate term is not to have the package in CRAN, but rather to distribute it (e.g. via GitHub) to workplace colleagues who can potentially use it. In your experience, is it worth it to create an R package to distribute functions, or documenting scripts with R Markdown is enough? What are the benefits of creating and documenting packages vs. other approaches?

R • 2.1k views
ADD COMMENT
2
Entering edit mode

What are the benefits of creating and documenting packages

The answer is already in the question

to distribute and document functions that I wrote.

If you have some regular tasks for which you have written some functions, it would definitely worth it to make a small library.

Advantages?

  • You don't need to copy them to each project directory you are working
  • If you host it on GitHub, you can install it through install_github() from devtools library (especially useful if you are working on different servers)
  • Bonus here is, people using your functions for their own work

is it worth it to create an R package to distribute functions, or documenting scripts with R Markdown is enough?

Of course it is.

And what do you mean by other approaches ? (not creating a library ?)

ADD REPLY
0
Entering edit mode

Thank you very much your answer, @venu. Yes, by other approaches I meant not creating a library, but sharing R scripts and R Markdown documentation via Github instead.

ADD REPLY
0
Entering edit mode

If the documentation is proper sharing via GitHub is also fine, using functions through source function is one way instead of creating library.

ADD REPLY

Login before adding your answer.

Traffic: 2706 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6