Dieter Menne <[EMAIL PROTECTED]> writes:

> getData returns non-null).  The lines I don't understand in plot.lme are 
> 
>             alist <- lapply(as.list(allV), as.name)
>             names(alist) <- allV
> # next line
>             alist <- c(as.list(as.name("data.frame")), alist)
>             mode(alist) <- "call"
>             data <- eval(alist, sys.parent(1))
> 
> This code turn up again and again in nlme, but I admit I don't understand 
> what 
> it means.
> 
> Anybody taking the challenge to dissect it?

Shouldn't be too hard:

allV is a vector of variable names (character vector)
first turn it into a list of R names (a.k.a. symbols)
then add names to the list identical to the original data
stick the symbol data.frame at the beginning and convert to call

This has the net effect that you generate a function call like

  data.frame(age=age, sex=sex, beauty=beauty)

finally, you evaluate that call in the parent frame, in which
presumably age, sex, and beauty will be defined,

-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to