[R] reusing custom functions, how to ?

Duncan Murdoch murdoch at stats.uwo.ca
Tue Apr 15 15:44:24 CEST 2008


Ng Stanley wrote:
> Hi,
>
> I have created a number of custom functions, and hope to reuse them in other
> source files. How should I go about doing that ?
>
>   
The best way is to create a package to hold them, then just use

library(MyPackage)

to attach them.  See Writing R Extensions for instructions.

Another way is to use source('file.R') to read them in.

Duncan Murdoch



More information about the R-help mailing list