Thanks very much to everyone. I think I will use a combination of both
techniques.
On 2009-March-22 , at 20:08 , Duncan Murdoch wrote:
That's pretty hard to make bulletproof. Why not just put those
functions in a package, and use that package?
I know it will be impossible to make bullet
I agree with Duncan. I used to do exactly what you did - source()ing data
files inside a wrapper not unlike C #define wrappers, but it became a
headache with more files and the files began looking more cluttered.
It has taken me several days to learn about how create a package properly,
along wi
On 22/03/2009 5:05 PM, JiHO wrote:
Hello everyone,
I often create some local "libraries" of functions (.R files with only
functions in them) that I latter call. In scripts that call a function
from such library, I would like to be able to test whether the
function is already known in the n
JiHO wrote:
> Hello everyone,
>
> I often create some local "libraries" of functions (.R files with only
> functions in them) that I latter call. In scripts that call a function
> from such library, I would like to be able to test whether the
> function is already known in the namespace and, only i
Try this:
if (!exists("myfun", mode = "function")) source("myfile.R")
Also check the other arguments of exists in case you want to
restrict the search.
On Sun, Mar 22, 2009 at 5:05 PM, JiHO wrote:
> Hello everyone,
>
> I often create some local "libraries" of functions (.R files with only
> fun
Hello everyone,
I often create some local "libraries" of functions (.R files with only
functions in them) that I latter call. In scripts that call a function
from such library, I would like to be able to test whether the
function is already known in the namespace and, only if it is not,
s
6 matches
Mail list logo