topoProfile: Elevation profiles of topographic paths

View source: R/topoProfile.R

topoProfileR Documentation

Elevation profiles of topographic paths

Description

Plots topographic cross sections (elevation profiles) of topographic paths

Usage

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

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)

topoDistance documentation built on Aug. 9, 2022, 1:05 a.m.