pl.control {plgraphics}R Documentation

Arguments for plotting functions

Description

Arguments that can be specified calling plyx and other 'pl' functions are checked and data is prepared for plotting.

Usage

pl.control(x=NULL, y=NULL, data = NULL, subset = NULL, transformed = TRUE,
  gensequence = NULL, cex = NULL, 
  psize = NULL, plab = FALSE, pch = NULL, pcol = NULL, cex.pch = NULL, 
  markextremes = NULL, smooth = NULL,
  xlab = NULL, ylab = NULL, varlabels = NULL,
  vcol = NULL, vlty = NULL, vpch = NULL, 
  main = NULL, sub = ":", .subdefault = NULL, mar = NULL, 
  ploptions = NULL, .environment. = parent.frame(), assign = TRUE, ... )

Arguments

x, y, data

as in plyx

subset

subset of data.frame 'data' to be used for plotting. See details.

transformed

logical: should transformed variables be used?

gensequence

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)?

cex

character expansion, applied to both labels and plotting characters.

psize, plab, pch, pcol

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.

cex.pch

expansion of plotting symbol relative to par("pch"). By default, it adjusts to the number of observations.

markextremes

scalar: proportion of extreme points to be labelled

smooth

logical: should a smooth line be added?

xlab, ylab

axis labels

varlabels

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.

vcol, vlty, vpch

color, line type and plotting character to be used when multiple y-s are plotted (in the sense of matplot)

main, sub

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.

.subdefault

for internal use: default of subtitle

mar

plot margins

ploptions

Plotting attributes, e.g., plotting character, line types, colors and the like, for different aspects of plots. Result of ploptions. Defaults to .ploptions.

.environment.

used by the calling function to provide the environment for evaluating x and y

assign

logical: should the result of pl.control be assigned to .plargs in the global 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.weightsthese specify graphical elements for each observation (row of data). the respective columns are added to the pldata data.frame.

  • any 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

Details

!!!

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.

Value

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 pdata. The component, plappearances, contains the result of calling the respective function or the corresponding component of the user options.

Author(s)

Werner A. Stahel

See Also

plyx, plmatrix, ploptions

Examples

plyx(Sepal.Width~Sepal.Length, data=iris, axp=7, plab=TRUE, cex.plab=0.6)
## same as
plargs <- pl.control(Sepal.Width~Sepal.Length, data=iris)
plargs$pdata$plab <- row.names(iris)
plargs$cex.lab <- 0.6
plargs$axp <- 7
plyx(Sepal.Width~Sepal.Length, plargs=plargs)


[Package plgraphics version 1.0 Index]