dist_calc: Calculate 2D and Cumulative Distance Between Coordinates

Description Usage Arguments Details Examples

View source: R/misc_functions.R

Description

Appends two columns to a data frame containing Longitude and Latitude coordinates. The first column (Dist) is the incremental change in distance between coordinates. The second column (DistTotal) is the cumulative distance along a 2D transect beginning at 0.

Usage

1
dist_calc(df, longlat = TRUE)

Arguments

longlat

logical for calculating Great Circle (TRUE) or Euclidean (FALSE) distances. Defaults to TRUE. Great Circle distance is returned in km.

x

data frame containing coordinate data as columns labeled "Longitude" (x) and "Latitude" (y).

Details

Relies on the spDistsN1 function from the package 'sp.'

Examples

1
df_dist <- dist_calc(df, longlat = TRUE)

bouzidnm/tinker documentation built on May 25, 2019, 11:31 p.m.