Arguments that can be specified calling plyx
and
other 'pl' functions are checked and data is prepared for plotting.
pl.control(x=NULL, y=NULL, condvar = NULL, data = NULL, subset = NULL,
transformed = TRUE, distinguishy = TRUE, gensequence = NULL,
csize = NULL, csize.pch = NULL,
psize = NULL, plab = FALSE, pch = NULL, pcol = NULL,
smooth.weights = NULL, smooth.weight = NULL,
markextremes = NULL, smooth = NULL,
xlab = NULL, ylab = NULL, varlabel = NULL,
vcol = NULL, vlty = NULL, vpch = NULL, plscale = NULL, log = NULL,
main = NULL, sub = NULL, .subdefault = NULL, mar = NULL,
gencoord = TRUE,
plargs = pl.envir, ploptions = NULL, .environment. = parent.frame(),
assign = TRUE, ... )
A list containing all the arguments, possibly in modified form. Specifically, the evaluations of the variables contained in
x
and y
along with
psize, plab, pch, pcol, smoothGroup, smoothWeights
are collected in the component pldata
.
The component, ploptions
, collects the ploptions, and
plfeatures
contains a list of additional features, both
to be used in the calling high level pl function
as in plyx
conditioning variables for plcond
subset of data.frame 'data' to be used for plotting. See details.
logical: should transformed variables be used?
logical: should multiple y's be distinguished?
This is TRUE
if pl.control
is called from
plyx
.
logical: if only x
or only y
is set,
should the other of these be specified as the sequence
1:nobs
(where nobs
is the number of observations)?
character expansion, applied to both labels and plotting characters.
expansion of plotting symbol relative to
par("pch")
.
By default, it adjusts to the number of observations.
Plotting characteristics of points,
specified as a (unquoted) variable name found in data
or as a vector.
They set the size of the plotting symbols, labels (character
strings), plotting character, and color, respectively.
plabs = TRUE
asks for using the row names of data
.
weights to be used in calculating smooth lines. Both are equivalent.
scalar: proportion of extreme points to be labelled
logical: should a smooth line be added?
axis labels
labels for variables replacing their names in the x
and
y
arguments, either a simple vector of strings with an
element for each variable,
or a named vector, where names correspond to such variables.
color, line type and plotting character
to be used when multiple y-s are plotted (in the sense of
matplot
)
plot scale: name of the function to be used for
generating a plotting scale, like "log"
.
A named character vector can be given, where the names correspond
to variable names in data
.
requires log scale as in R's basic plot function,
e.g., equals either "x"
, "y"
or "xy"
string. Main title of the plot(s).
If sub
starts by ":"
(the default),
pl.control
tries to generate an informative subtitle,
determined by the data or a model formula.
for internal use: default of subtitle
plot margins
logical: should plotting coordinates be generated? This is avoided for low level pl graphics.
pl arguments, a list with components
ploptions
, see the following argument;
pldata
, the data used for plotting;
pmarpar
, graphical parameters defining margins.
Plotting attributes, e.g., plotting character,
line types, colors and the like, for different aspects of plots.
Result of ploptions
. Defaults to
pl.envir$ploptions
.
used by the calling function to provide the
environment for evaluating x
and y
logical: should the result of pl.control
be
assigned to the pl.envir
environment?
This will be done for high level pl functions, but avoided for low
level ones. It allows for reusing the settings and helps debug
unexpected behavior.
further arguments. These may include:
psize, plab, pch, pcol, group, smooth.group,
smooth.weights
: these specify graphical elements for each
observation (row of data
).
the respective columns are added to the pldata
data.frame.
...
: further ...
arguments will be passed on to
ploptions
. The respective settings will be used
in the calling pl function, but not permanently stored
in ploptions
in the pl.envir
environment.
Werner A. Stahel
The function selects the data according to the arguments
x, y, data
and subset
(the latter by calling
plsubset
).
The argument subset
should be used instead of
data[subset,]
if the dataset data
contains variable
attributes like varlabel, ticksat, ...
.
The argument is evaluated in the dataset defined by data
,
i.e., variable names may be used to define the subset.
plyx
, plmatrix
, ploptions
plyx(Sepal.Width~Sepal.Length, data=iris, axp=7, plab=TRUE, csize.plab=0.6)
## same as
plargs <- pl.control(Sepal.Width~Sepal.Length, data=iris)
plargs$pdata$plab <- row.names(iris)
plargs$csize.lab <- 0.6
plargs$axp <- 7
plyx(Sepal.Width~Sepal.Length, plargs=plargs)
Run the code above in your browser using DataLab