Learn R Programming

geo (version 1.4-3)

geoconvert: Convert latitude and longitude

Description

Convert between different representations of latitude and longitude, namely degrees-minutes-decimal minutes and decimal degrees.

Usage

geoconvert(data, inverse = F, col.names = c("lat", "lon"))

Arguments

data
Dataframe with coordinates in two columns
inverse
Which conversion should be undertaken, default from degrees-minutes-decimal minutes (DDMMmm) to decimal degrees (DD.dd)
col.names
Colnames in data with coordinates to convert, default lat, lon

Value

Returns data with converted values in the coordinate columns.

See Also

Called by a number of functions, i.e. d2mr, mr2d, geogrid, geoidentify, geolines, geopoints, geopolygon and geotext, perhaps unncessarily in some. Wraps around functions geoconvert.1 and geoconvert.2, depending on which conversion to undertake.