Re: [R] Nested source()s

From: Adaikalavan Ramasamy <ramasamy_at_cancer.org.uk>
Date: Mon 12 Jul 2004 - 22:56:02 EST

Yes, I have source()-ed recursively without problems before. Try sourcing the second script on its own and see what errors it has.

I have download lkpack.zip
(http://www.mep.ki.se/~yudpaw/likelihood/lkpack.zip) and source("EX2-13.R") and source("li.r") which is called without problem. The timestamp appears to show that it was not modified recently.

Are you sure you have the latest version ?

On Mon, 2004-07-12 at 12:45, Rolf Turner wrote:
> Murray Jorgensen wrote:
>
> > I had an error message while running a macro from Yudi Pawitan's web site:
> >
> > > source("ex2-13.r")
> > Error in parse(file, n, text, prompt) : syntax error on line 2
> >
> > Inspecting ex2-13.r I found that the error was generated by another
> > source() command.
> >
> > Clearly R does not like nested source()s, which is fair enough when you
> ^^^^^^^
> |||||||
> Nothing clear about it!
>
> > think about it. Still it's something that you might want to do. Does
> > anyone know how to get achieve the substance of what nested source()
> > commands would give you?
>
> You're leaping to conclusions, mate. There is no
> proscription of nested sources in R. I just checked
> this: I built a file called ``melvin'':
>
> x <- 42
> source('clyde')
>
> and a file called ``clyde'':
>
> y <- 2*x
> print(y)
>
> and then executed
>
> > source('melvin')
>
> and got
>
> [1] 84
>
> OMMMMMMMMMMMMMMMMMMMMMMM.
>
> There is something else wrong in the files that you
> are sourcing.
>
> cheers,
>
> Rolf
> rolf@math.unb.ca
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jul 12 23:03:57 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:50 EST