| num2deg | 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 |
dec |
whether to return decimal degrees instead of deg:min:sec. |
digits |
precision used when rounding decimal degrees or seconds. |
zero |
whether trailing |
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.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.