| genvarattributes | R Documentation | 
genvarattributes generates attributes of variables that are
useful for the plgraphics functions.
It is called by pl.control.
setvarattributes modifies or sets such attributes.
genvarattributes(data, vnames = NULL, vcol = NULL, vlty = NULL, vpch = NULL,
  varlabel = NULL, innerrange = NULL, plscale = NULL, zeroline = NULL, 
  replace=FALSE, ploptions = NULL, ...)
setvarattributes(data, attributes = NULL, list = NULL, ...)
data | 
 data.frame consisting of the variables (columns) to be characterized by their attributes  | 
vnames | 
 names of variables to be treated as y variables  | 
vcol, vlty, vpch | 
 color, line type and plotting character
to be used when multiple y-s are plotted (in the sense of
  | 
varlabel | 
 labels of the variables, in the case that the
  | 
innerrange | 
 logical indicating whether inner plotting ranges should be determined and/or used. May also be the limits of the inner plotting range, if predetermined, see Details  | 
plscale | 
 plot scale: name of the function to be used for
generating a plotting scale, like   | 
zeroline | 
 value(s) for which a horizontal or vertical line will be
drawn (in addition to the gridlines). The default is given by
  | 
ploptions | 
 list containing the plotting elements needed to set the attributes  | 
replace | 
 logical: should existing attributes be replaced?  | 
attributes | 
 (for   | 
list | 
 a list of attributes to be set.
Each component must have a name giving the name of the variable
attribute to be set, and be itself a list (or a vector).
This list must have names that identify the variables in 
  | 
... | 
 further arguments, which will be collected and used as or
added to   | 
If the attribute innerrange is replaced, then plcoord is
also replaced.
innerrange may be a named list of ranges with names
corresponding to variables (not necessarily all of them),
or a scalar vector of length 2 to be used as range for all the
variables. 
It can also be a logical vector superseding the argument
innerrange, either named (as just mentioned) or
unnamed, to be repeated the appropriate number of times.
Data.frame, returning the original values, but the variables are
supplemented by the following attributes, where available:
nvalues | 
 number of distinct values  | 
innerrange | 
 inner plotting range  | 
plcoord | 
 plotting coordinates  | 
ticksat | 
 tick marks for axis  | 
varlabel | 
 label to be used as axis label  | 
zeroline | 
 value(s) for which a horizontal or vertical line will be drawn (in addition to the gridlines)  | 
Werner A. Stahel
par
data(d.blast)
dd <- genvarattributes(d.blast)
str(attributes(dd$tremor))
ddd <- setvarattributes(dd, list( tremor=list(ticksat=seq(0,24,2),
  ticklabelsat = seq(0,24,10), ticklabels=c("low","medium","high")) ) )
str(attributes(ddd$tremor))
data(d.river)
plyx(O2+H2CO3+T ~ date, data=d.river, subset=as.Date(date)<as.Date("2010-02-28"))
dd <- setvarattributes(d.river,
  list=list(vcol=c(O2="blue", T="red")), vpch=c(O2=1, T="T", H2CO3=5) )
attributes(dd$O2)
plyx(O2+H2CO3+T ~ date, data=d.river, subset=as.Date(date)<as.Date("2010-02-28"),
  plscale = c(O2="log", H2CO3="log") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.