[R] differences in using source() or console

vito muggeo vmuggeo at dssm.unipa.it
Thu Dec 6 14:01:29 CET 2007


Dear all,
Is there *any* reason explaining what I describe below?
I have the following line

myfun(x)

If I type them directly in R (or copy/past), it works..

However if I type in R 2.6.1

 > source("code.R") ##code.R includes the above line
Error in inherits(x, "data.frame") : object "d" not found

namely myfun() does not work correctly.
In particular the non-working line inside myfun() is

update(eval(x$call$obj), data=d) #d is created in myfun()

My question is: why the problem occurs just via source()ing???

many thanks,
vito


====================================
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612



More information about the R-help mailing list