[R] sourcing a file with the plot.lme() function

Roger Peng rpeng at stat.ucla.edu
Wed Aug 28 06:58:48 CEST 2002


I ran into a problem trying to make a plot from a file that's read using
source.  Basically, I have the following code in a file "plot.R" :

library(nlme)
data(Loblolly)
fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc),
            data = Loblolly,
            fixed = Asym + R0 + lrc ~ 1,
            random = Asym ~ 1,
            start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
windows(6,6)
plot(fm1)

This code is taken from the help page for 'nlme'.  If I cut an paste this
code into the console, everything works as expected.  However, if I try to
execute the code by calling source("plot.R") the plot is never made.  Has
anyone seen this?


> version
         _              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    1              
minor    5.1            
year     2002           
month    06             
day      17             
language R              

-roger
_______________________________
UCLA Department of Statistics
rpeng at stat.ucla.edu
http://www.stat.ucla.edu/~rpeng

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list