You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Generate contour lines (isolines) and contour polygons (isobands) fromregularly spaced grids containing elevation data. Package originallywritten by Claus Wilke and donated to r-lib in 2022.
Installation
Install the latest official release from CRAN via:
The two main workhorses of the package are the functionsisolines()andisobands(), respectively. They return a list of isolines/isobandsfor each isolevel specified. Each isoline/isoband consists of vectors ofx and y coordinates, as well as a vector of ids specifying which sets ofcoordinates should be connected. This format can be handed directly togrid.polyline()/grid.path() for drawing. However, we can alsoconvert the output to spatial features and draw with ggplot2 (seebelow).
The functionplot_iso() is a convenience function for debugging andtesting.
plot_iso(m,0.5,1.5)
The isolining and isobanding algorithms have no problem with largerdatasets. Let’s calculate isolines and isobands for the volcano dataset,convert to sf, and plot with ggplot2.