get_elevation_gain: (Cumulative) Elevation gain.

View source: R/helpers.R

get_elevation_gainR Documentation

(Cumulative) Elevation gain.

Description

(Cumulative) Elevation gain.

Usage

get_elevation_gain(
  object,
  smooth = FALSE,
  cumulative = FALSE,
  vertical_noise = 0
)

Arguments

object

A (univariate) zoo object.

smooth

Logical. Should the elevation be smoothed? Default is TRUE.

cumulative

Logical. Return the cumulative elevation gain (FALSE; default) or just the elevation gain?

vertical_noise

A scalar. Absolute elevation gains less that vertical_noise are set to zero. Default is 0.

Details

The elevation gain is defined here as the difference in altitude between two consecutive observations. If cumulative = FALSE then the elevation gain is returned, otherwise any elevation loses (i.e. negative elevation gain) are ignored and the cumulative elevation gain is returned. If smooth = TRUE then the elevation gain will be smoothed using a spline smoother before either returning it or computing cumulative elevation gains.


hfrick/trackeR documentation built on Feb. 3, 2024, 2:30 p.m.