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

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Thu Nov 10 08:39:05 CET 2011

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 of the data you are working with to arrive at the point where you are stuck in your email is rather important to getting the most useful assistance on this mailing list.
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

Aimee Jones <alj27 at hoyamail.georgetown.edu> 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 rather than as functions and I am
>struggling with the syntax to make R read them as a function instead.
>Below is a small set of the things I have tried:
>returns the character string {2*dnorm(T1(t),mean=32.5,sd=7)} . This is
>from the imported script "parms".
>when I write B1<-function(T1,t) (parms["B1"]) and then enter B1 to see
>what the workspace returns, I get
>function(T1,t) (parms["B1"])
>I am trying to get B1 to return as function(T1,t)
>{2*dnorm(T1(t),mean=32.5,sd=7)}, so that I can plot B1(T1,t).
>Is there any way to do this?
>Thank you for your assistance and patience,
>yours sincerely,
>Aimee Jones
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list