Source .R file as an R package

say I have a file utils.R than contains some functions foo, moo

I'd like to be able to source this file and then refer to the functions and source file like a typical R package, say:

customSource(file='utils.R', name='my_utils')
mu_utils::foo()
mu_utils::moo()

How can this be done?



Read more here: https://stackoverflow.com/questions/49757823/source-r-file-as-an-r-package

Content Attribution

This content was originally published by not.so.quanty at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: