Extracting Plotting Structures
xy.coords is used by many functions to obtain
x and y coordinates for plotting. The use of this common mechanism
across all relevant Rfunctions 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
a way suitable for bivariate plotting (or other bivariate procedures).
x is a
[object Object],[object Object],[object Object],[object Object]
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
component is set to
x (after transformation as above) inherits from class
"POSIXt" it is coerced to class
- A list with the components
x numeric (i.e.,
"double") vector of abscissa values.
y numeric vector of the same length as
xy.coords(stats::fft(c(1:9)), NULL) with(cars, xy.coords(dist ~ speed, NULL)$xlab ) # = "speed" xy.coords(1:3, 1:2, recycle = TRUE) xy.coords(-2:10, NULL, log = "y") ##> warning: 3 y values <= 0 omitted ..