dmsparse: Parse coordinate strings into separate degree, minute and...

Description Usage Arguments Value Author(s) See Also Examples

Description

Separates (parse) coordinates into separate columns, provided that there are delimiters between the degrees, minutes and seconds e.g. 27 27'E. The can be several different formats and delimiters in the input.

Usage

1
dmsparse(dat, x = "long", y = "lat", id = "ID")

Arguments

dat

A dataframe containing columns for latitude, longitude and a unique identifier (ID)

x

The name of the longitude column (default long)

y

The name of the latitude column (default lat)

id

A column containing a unique identifier for that row. The name of the field must be "ID".

Value

A dataframe containing the input columns and new columns for degrees, minutes, seconds and decimal degrees for latitude and longitude

Author(s)

Mark Robertson and Vernon Visser

See Also

dms2dd, getformat, parsecoords, dmsabs

Examples

1
2
3
4
## Not run: 
head(places)
p<-dmsparse(places,x='long',y='lat',id='id')
## End(Not run)

Example output

  id       Place            long             lat
1  1     Chimoio       33 28.9 E       19 6.98 S
2  2 Grahamstown   26d31m59.98 E   33d17m60.00 S
3  3      Kenton      26*38'59"E    33*40'0.01"S
4  4   Ladybrand        27*27' E        29*12' S
5  5        Maun         23 25 E         19 58 S
6  6  Mwinilunga E 24 25 59.9880 S 11 43 59.9880

biogeo documentation built on May 1, 2019, 8:05 p.m.