deg2str | R Documentation |
Convert a decimal-degree coordinate to a formatted character string suitable for printing.
deg2str(
deg = NULL,
latitude = NULL,
longitude = NULL,
clip = TRUE,
northing = TRUE,
easting = TRUE,
as.list = FALSE,
language = "english",
...
)
deg |
A numeric vector of coordinates in decimal degree format. |
longitude , latitude |
Numeric decimal degree coordinate value(s). If |
clip |
A logical value. Whether to strip away coordinate seconds or
minutes and seconds when they have zero values. The resulting output strings
are of an abridged form. The default is |
northing , easting |
Logical value specifying whether to include a Northing (i.e. "N" or "S")
or Easting (i.e. "E" or "W") character in the output string when |
as.list |
Logical value specifying whether to return the output as a list object. The default is |
language |
Lanaguage with which to state easting and northing symbols. |
If a single argument is provided and as.list is FALSE, then the
returned output is a character string vector. Otherwise, the output is
returned as a list with fields longitude
and latitude
.
deg2dms
, deg2dmm
# Convert generic coordinate:
deg2str(c(45, 47.5))
deg2str(c(45, 47.5), clip = FALSE)
# Convert latitude coordinate, which adds the northing character to the output:
deg2str(lat = c(45, 47.5))
deg2str(long = c(-66, -66.5))
# Convert vectors of lat-long coordinates, which are returned as a list:
deg2str(latitude = 45:47, longitude = -64:-66, clip = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.