dms | R Documentation |
extract degree, minutes, and seconds
pz_degree(lon = NULL, lat = NULL) pz_minute(lon = NULL, lat = NULL) pz_second(lon = NULL, lat = NULL) ## S3 method for class 'pz' print(x, ...) pz_d(x) pz_m(x) pz_s(x) ## S3 method for class 'pz' e1 + e2 ## S3 method for class 'pz' e1 - e2 ## S3 method for class 'pz' e1 / e2 ## S3 method for class 'pz' e1 * e2
lon, lat |
(numeric/integer/character) one or more longitude or latitude values. values are internally validated. only one of lon or lat accepted |
x |
(integer) an integer representing a degree, minute or second |
... |
print dots |
e1, e2 |
objects of class pz, from using |
Mathematics operators are exported for +
, -
, /
, and *
,
but /
and *
are only exported with a stop message to say it's not
supported; otherwise you'd be allow to divide degrees by minutes, leading
to nonsense.
pz_degree
: integer, pz_minute
: integer, pz_second
: numeric,
pz_d
: numeric, pz_m
: numeric, pz_s
: numeric (adding/subtracting
these also gives numeric)
# extract parts of a coordinate value pz_degree(-45.23323) pz_minute(-45.23323) pz_second(-45.23323) pz_degree(lon = 178.23423) pz_minute(lon = 178.23423) pz_second(lon = 178.23423) ## Not run: pz_degree(lat = c(45.23323, "40:25:6N", "40° 25´ 5.994 S")) pz_minute(lat = c(45.23323, "40:25:6N", "40° 25´ 5.994 S")) pz_second(lat = c(45.23323, "40:25:6N", "40° 25´ 5.994 S")) # invalid pz_degree(445.23323) # add or subtract pz_d(31) pz_m(44) pz_s(3) pz_d(31) + pz_m(44) pz_d(-31) - pz_m(44) pz_d(-31) + pz_m(44) + pz_s(59) pz_d(31) - pz_m(44) + pz_s(59) pz_d(-121) + pz_m(1) + pz_s(33) unclass(pz_d(31) + pz_m(44) + pz_s(59)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.