| num2deg {gmt} | R Documentation |
Convert decimal number to deg:min:sec string.
num2deg(x, lat=NA, dec=FALSE, digits=0, zero=FALSE)
x |
number or vector of numbers. |
lat |
whether x is latitude. |
dec |
whether to return decimal degrees instead of deg:min:sec. |
digits |
precision used when rounding decimal degrees or seconds. |
zero |
whether trailing :00 zeros should be retained. |
Element-specific format is supported, using vectors for lat,
digits, and precision.
The resulting string ends with N or S when lat is TRUE,
E or W when lat is FALSE, or a number when lat is
NA.
deg:min:sec string representation of the number(s).
The string format is adopted from Appendix B.1.1 in the GMT manual.
Arni Magnusson arnima@u.washington.edu.
as.character converts plain numbers to strings.
num2deg is the opposite of deg2num.
gmt-package gives an overview of the package.
# The opposite of deg2num() example
num2deg(c(-12.51236, -17.5, 1.00139, 200.75),
lat=c(FALSE, TRUE, NA, FALSE),
dec=c(FALSE, TRUE, FALSE, FALSE),
digits=c(1, 1, 0, 0))