xy.coords is used by many functions to obtain x and y coordinates for plotting. The use of this common mechanism across all relevant R functions produces a measure of consistency.
xy.coords(x, y = NULL, xlab = NULL, ylab = NULL, log = NULL, recycle = FALSE)
- x, y
- the x and y coordinates of a set of points. Alternatively, a single argument
xcan be provided.
- xlab, ylab
- names for the x and y variables to be extracted.
"y"or both, as for
plot. Sets negative values to
NAand gives a warning.
- logical; if
TRUE, recycle (
rep) the shorter of
yif their lengths differ.
An attempt is made to interpret the arguments
y in a way suitable for bivariate plotting (or other bivariate procedures).
x is a
- of the form
yvar ~ xvar.
yvarare used as x and y variables.
- containing components
y, these are used to define plotting coordinates.
- time series:
- the x values are taken to be
time(x)and the y values to be the time series.
- matrix or
data.framewith two or more columns:
- the first is assumed to contain the x values and the second the y values. Note that is also true if
xhas columns named
"y"; these names will be irrelevant here.
In any other case, the
x argument is coerced to a vector and returned as y component where the resulting
x is just the index vector
1:n. In this case, the resulting
xlab component is set to
x (after transformation as above) inherits from class
"POSIXt" it is coerced to class
A list with the components
Documentation reproduced from R 2.15.3. License: GPL-2.