topoProfile: Elevation profiles of topographic paths

Description Usage Arguments Details Value Examples

View source: R/topoProfile.R

Description

Plots topographic cross sections (elevation profiles) of topographic paths

Usage

1
2
3
topoProfile(DEM, topoPaths, pts = 100, type = "base",
  singlePlot = FALSE, rows = NULL, cols = NULL, limits = NULL,
  legendx = "bottomright")

Arguments

DEM

A RasterLayer for digital elevation model (DEM) data.

topoPaths

A SpatialLines object containing the topographic paths to be plotted.

pts

numeric (default = 100). The number of elevation points to plot along each path.

type

character (default = "base"). Type of plotting: "base" or "plotly".

singlePlot

logical (default = FALSE). If TRUE, profiles will be drawn on a single plot.

rows

numeric (optional). Number of rows for plot layout (if singlePlot = FALSE)

cols

numeric (optional). Number of columns for plot layout (if singlePlot = FALSE)

limits

numeric vector (optional). A vector with the lower and upper limits for the y-axis (elevation).

legendx

character (default = "bottomright"). Position for the legend.

Details

For the type argument, choosing "base" will use base R plotting, and choosing "plotly" will draw an interactive plot with the plotly package.

If rows, cols, or limits are not specified, the most even arrangement will be detected and used.

Value

Plot of elevation profiles

Examples

1
2
3
4
5
xy <- matrix(ncol = 2, byrow = TRUE,
   c(-119.5566, 37.7247,
     -119.4718, 37.7608))
YosPaths <- topoDist(Yosemite$DEM, xy, paths = TRUE)
topoProfile(Yosemite$DEM, topoPaths = YosPaths)

Example output

Warning messages:
1: In .local(x, n, type, ...) :
  working under the assumption of projected data!
2: In brewer.pal(length(elevations), "Set1") :
  minimal value for n is 3, returning requested palette with 3 different levels

topoDistance documentation built on Aug. 2, 2019, 5:05 p.m.