[R] xyplot does not find variable in data
gunter.berton at gene.com
Mon Oct 12 20:17:10 CEST 2009
Deepayan will correct me if I'm wrong, but I'm pretty sure that the answer
is that it looks in the frame in the data argument only for variables in the
formula argument. Note that the fact that it also works for the subset
argument is explicitly mentioned therein:
subset: logical or integer indexing vector **(can be specified in terms of
variables in data). **
FWIW, I agree that this is not as clearly documented as I think it could be:
I kind of intuited it after a bunch of trial and error.
Genentech Nonclinical Biostatistics
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Jacob Wegelin
Sent: Monday, October 12, 2009 9:33 AM
To: r-help at stat.math.ethz.ch
Subject: [R] xyplot does not find variable in data
When we call a lattice function such as xyplot, to what extent does
the "data" designation cause the function to look inside the "data"
In the examples below, the "subset" argument understands that
"Variety" is a variable in the data.
But the "scales" argument does not understand that "nitro" is a
variable in the data.
What principle is at work?
# The following works fine:
yield ~ nitro
# But the following returns an error:
yield ~ nitro
Thanks for any insight
Jacob A. Wegelin
Department of Biostatistics
Virginia Commonwealth University
730 East Broad Street Room 3006
P. O. Box 980032
Richmond VA 23298-0032
E-mail: jwegelin at vcu.edu
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help