contourLines
Calculate Contour Lines
Calculate contour lines for a given set of data.
 Keywords
 dplot
Usage
contourLines(x = seq(0, 1, length.out = nrow(z)), y = seq(0, 1, length.out = ncol(z)), z, nlevels = 10, levels = pretty(range(z, na.rm = TRUE), nlevels))
Arguments
 x, y
 locations of grid lines at which the values in
z
are measured. These must be in ascending order. By default, equally spaced values from 0 to 1 are used. Ifx
is alist
, its componentsx$x
andx$y
are used forx
andy
, respectively. If the list has componentz
this is used forz
.  z
 a matrix containing the values to be plotted (
NA
s are allowed). Note thatx
can be used instead ofz
for convenience.  nlevels
 number of contour levels desired iff
levels
is not supplied.  levels
 numeric vector of levels at which to draw contour lines.
Details
contourLines
draws nothing, but returns a set of contour lines.
There is currently no documentation about the algorithm. The source code is in ‘R_HOME/src/main/plot3d.c’.
Value

A list of contours.
Each contour is a list with elements:
 level
 The contour level.
 x
 The xcoordinates of the contour.
 y
 The ycoordinates of the contour.
See Also
options("max.contour.segments")
for the maximal
complexity of a single contour line.
Examples
library(grDevices)
x < 10*1:nrow(volcano)
y < 10*1:ncol(volcano)
contourLines(x, y, volcano)
Community examples
Looks like there are no examples yet.