lonDist: Calculate distance between two longitudes

View source: R/lonDist.R

lonDistR Documentation

Calculate distance between two longitudes

Description

This function is intended to calculate the distance between two longitudes at a given latitude. If only one longitude location is supplied, the length of 1 deg of longitude is calculated at the given latitude.

Usage

lonDist(lon_min, lon_max = NULL, lat, to_km = TRUE, ...)

Arguments

lon_min

numeric. The starting longitude.

lon_max

numeric. The (optional) end longitude. If not supplied, the argument automatically equals lon_min + 1.

lat

numeric. The latitude for which to calculate longitude distance.

to_km

logical. Determines whether the calculated distance is returned in kilometers (default) or miles.

...

Currently not in use.

Value

The linear distance between the starting and end longitude at the given latitude or, if argument lon_max is not supplied, the length of 1 deg of longitude at the given latitude.

Author(s)

Florian Detsch

Examples

lonDist(lon_min = 0, lat = 0)


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.