Learn R Programming

gmt (version 1.0-0)

deg2num: Convert Degrees to Number

Description

Convert deg:min:sec string to decimal number.

Usage

deg2num(x)

Arguments

x
string or vector of strings

Value

  • Numeric representation of the degree string(s).

Details

Degrees, minutes and seconds are separated by colons, and each can have a decimal point as well. First character must be a minus sign or number, and last character must be W, E, S, N, or number.

References

Wessel, P. and W.H.F. Smith. 2004. The Generic Mapping Tools: Technical reference and cookbook. Version 4. Available at http://gmt.soest.hawaii.edu/gmt/doc/pdf/GMT$\_$Docs.pdf.

See Also

as.numeric converts some strings to numbers.

Examples

Run this code
deg2num(c("12:30:44.5W", "17.5S", "1:00:05", "200:45E"))

Run the code above in your browser using DataLab