Re: [R] How does once import a function from an imported script?

2011-11-10 Thread David Winsemius
On Nov 9, 2011, at 9:11 PM, Aimee Jones wrote: Hi all, I am trying to import some functions into a script and am having difficulty in doing so. I am able to import a series of functions from a .tex file into my script, and call on each function by column name, however R reads them as data

Re: [R] How does once import a function from an imported script?

2011-11-10 Thread R. Michael Weylandt
Going down the text parsing approach, you might want to use something like this: fnc - eval(parse(text=function(x) dnorm(x))) all.equal(1/sqrt(2*pi), fnc(0)) [1] TRUE On Thu, Nov 10, 2011 at 8:55 AM, David Winsemius dwinsem...@comcast.net wrote: On Nov 9, 2011, at 9:11 PM, Aimee Jones wrote:

[R] How does once import a function from an imported script?

2011-11-09 Thread Aimee Jones
Hi all, I am trying to import some functions into a script and am having difficulty in doing so. I am able to import a series of functions from a .tex file into my script, and call on each function by column name, however R reads them as data rather than as functions and I am struggling with the

Re: [R] How does once import a function from an imported script?

2011-11-09 Thread Jeff Newmiller
TeX is not R. You need to (manually) extract whatever R syntax is in the TeX file into an R file. Then you can use the source function to load those definitions into your working environment. I highly recommend reading the posting guide as well. Including the R statements you run and a sample