convertTropicosCoords: Convert coordinates from TROPICOS records to decimal degrees

View source: R/convertTropicosCoords.r

convertTropicosCoordsR Documentation

Convert coordinates from TROPICOS records to decimal degrees

Description

The TROPICOS (http://www.tropicos.org/) plant specimen database of the Missouri Botanical Garden returns records in degrees-minutes-seconds format with symbols for degrees, minutes, second, and hemisphere. This function converts this format to signed decimal degrees format. By default, values surrounded by square brackets ([]) are returned as NA because they are geolocated to the center of a political unit (usually county or equivalent).

Usage

convertTropicosCoords(x = NULL, long = NULL, lat = NULL)

Arguments

x

A data frame with data downloaded from TROPICOS. If x is supplied then the script will guess which fields pertain to longitude and latitude. The advantage of supplying x (versus long and lat is that the data in x is returned plus fields for decimal longitude and latitude and whether or not the record is approximate. The default value is NULL.

long

Character list, longitudes in TROPICOS format. If this is supplied then do not supply x.

lat

Character list, latitudes in TROPICOS format. If this is supplied then do not supply x.

Value

A data five-column frame. The first two columns are the original TROPICOS coordinates, the next two the converted coordinates, and the last a flag to indicate if the TROPICOS coordinates were approximate (TRUE) or "exact" (FALSE) or missing (NA).

See Also

dmsToDecimal

Examples

long <- c("078°14'05\"\"W", "091°49'39\"\"W", NA, "[091°53'38\"\"W]")
lat <- c("39°40'41\"\"N", "36°34'14\"\"S", NA, "[36°46'14\"\"N]")
convertTropicosCoords(long=long, lat=lat)

adamlilith/enmSdm documentation built on Jan. 6, 2023, 11 a.m.