Skip to content
Prev 67124 / 398506 Next

Introduce a new function in a package?

On Wed, Apr 06, 2005 at 09:57:00AM -0400, Roger D. Peng wrote:
Alternatively, one can also write the function in question into one's
~/.Rprofile; then, it's automatically available in all R sessions.
To avoid confusion, make sure that you choose a unique name, i.e. one
that isn't used by any package, if possible.

This method should be used only for functions intended to provide some
convenience in interactive sessions, code in scripts should not rely
on functions being provided by ~/.Rprofile. For scripting, an R package
is definitely preferred.

Best regards, Jan