source reusable r functions

LabKey Support Forum (Inactive)
source reusable r functions laurapas  2015-05-07 16:58
Status: Closed
 
I will have some r functions that I'd like to reuse within modules and standalone reports. Do you have any recommendations for storage and source() of reusable r functions within LabKey? I suppose I could create a package and include in our R installation, but I was wondering if there is another way to store/access my reusable functions.
 
 
Jon (LabKey DevOps) responded:  2015-05-07 20:36
Hi Laura,

Storing your functions as a personal R package is actually the best way to go. Here is some documentation of people who've done just that:

http://kbroman.org/steps2rr/pages/packages.html (the entire page http://kbroman.org/steps2rr/ has a pretty good no-nonsense approach that you can follow along)

http://hilaryparker.com/2013/04/03/personal-r-packages/ (a good note of how the personal R package was on GitHub and how it was used as an R library).

So you can have your R functions up on GitHub in your own project and use it easily as mentioned in the second link.

Regards,

Jon