Re: [R] Sweave() within a function: objects not found

2009-11-12 Thread Pfaff, Bernhard Dr.
> >On 11/11/2009 12:09 PM, Pfaff, Bernhard Dr. wrote: >> Dear list subscriber, >> >> suppose, I do have a minimal Sweave file 'test.Rnw': >> \documentclass{article} >> \begin{document} >> <>= >> x >> @ >> \end{document} >> >> >> Within R, I define the following function: >> >> f <- function(x)

Re: [R] Sweave() within a function: objects not found

2009-11-11 Thread Duncan Murdoch
On 11/11/2009 12:09 PM, Pfaff, Bernhard Dr. wrote: Dear list subscriber, suppose, I do have a minimal Sweave file 'test.Rnw': \documentclass{article} \begin{document} <>= x @ \end{document} Within R, I define the following function: f <- function(x){ Sweave("test.Rnw") } The call: f(x =

[R] Sweave() within a function: objects not found

2009-11-11 Thread Pfaff, Bernhard Dr.
Dear list subscriber, suppose, I do have a minimal Sweave file 'test.Rnw': \documentclass{article} \begin{document} <>= x @ \end{document} Within R, I define the following function: f <- function(x){ Sweave("test.Rnw") } The call: f(x = 1:10) results in the following error message: > f(x