cumulative_distance: Calculate the cumulative distance (in km).

View source: R/cumulative.R

cumulative_distanceR Documentation

Calculate the cumulative distance (in km).

Description

The calculated distance also for position reports on the ground; the algorithm used is the one of distCosine.

Usage

cumulative_distance(positions)

Arguments

positions

the position reports for the flight

Value

a dataframe with a new cumulative_distance column (in km)

See Also

Other analysis: cumulative_time(), extract_segment(), filter_outlier(), smooth_positions()

Examples

## Not run: 
cumulative_distance(poss)
# calculate only the flown distance
# NOTE: there is a gap in FR24 data between last ground position (if any)
#       and first in air one (typically at ~1500 ft).
#       The following code would certainly work better
#       would poss contain a position report for a very low altitude.
cumulative_distance(poss %>% filter(altitude > 0))

## End(Not run)

euctrl-pru/trrrj documentation built on April 15, 2024, 1:24 p.m.