contourLinesR {contoureR} | R Documentation |
Get Contour Lines (list)
Description
A wrapper to the getContourLines
function, provided to ease the transition from
the contourLines
function as part of grDevices
Usage
contourLinesR(x, y, z, nlevels = 10, levels = pretty(range(z, na.rm =
TRUE)), ...)
Arguments
x |
Numeric data for x and y coordinate, a single matrix or data-frame object can be provided for
|
y |
Numeric data for x and y coordinate, a single matrix or data-frame object can be provided for
|
z |
numeric Data for z coordinate (the coordinate to model) |
nlevels |
An integer number of bins to split the data into iff |
levels |
A numeric vector of the explicitly specified levels (z values) to contour, by specifying this argument,
it will override |
... |
any other parameters passed through to |
Details
This function returns data in the same format/structure as contourLines
,
ie, list of lists, which is different from the (preferred) dataframe
object returned
by the getContourLines
function as part of the present work.
Value
A list of contours is returned, Each contour is a list with the elements:
level |
The contour of the level |
x |
The x-coordinates of the contour |
y |
The y-coordinates of the contour |
See Also
Examples
library(contoureR)
library(ggplot2)
x = runif(100)
y = runif(100)
df = expand.grid(x=x,y=y)
z = with(df,x+y)
result = contourLinesR(df$x,df$y,z)