Format geographical positions to degrees, minutes, and hemispheres
Usage
formatPosition(
latlon,
isLat = TRUE,
type = c("list", "string", "expression"),
showHemi = TRUE
)
Value
A list containing degrees
, minutes
, seconds
,
and hemispheres
, or a vector of strings or (broken) a vector of
expressions.
See also
Other functions related to maps:
lonlat2map()
,
lonlat2utm()
,
map2lonlat()
,
mapArrows()
,
mapAxis()
,
mapContour()
,
mapCoordinateSystem()
,
mapDirectionField()
,
mapGrid()
,
mapImage()
,
mapLines()
,
mapLocator()
,
mapLongitudeLatitudeXY()
,
mapPlot()
,
mapPoints()
,
mapPolygon()
,
mapScalebar()
,
mapText()
,
mapTissot()
,
oceCRS()
,
oceProject()
,
shiftLongitude()
,
usrLonLat()
,
utm2lonlat()
Examples
library(oce)
formatPosition(10 + 1:10 / 60 + 2.8 / 3600)
#> expression(c(10, 10, 10, 10, 10, 10, 10, 10, 10, 10), c(1, 2,
#> 3, 4, 5, 6, 7, 8, 9, 10), c(2.8, 2.8, 2.8, 2.8, 2.8, 2.8, 2.8,
#> 2.8, 2.8, 2.8), c("N", NA, NA, NA, NA, NA, NA, NA, NA, NA), NULL,
#> NULL, NULL, NULL, NULL, NULL)
formatPosition(10 + 1:10 / 60 + 2.8 / 3600, type = "string")
#> expression("10 01' 2.80\" N", "10 02' 2.80\" NA", "10 03' 2.80\" NA",
#> "10 04' 2.80\" NA", "10 05' 2.80\" NA", "10 06' 2.80\" NA",
#> "10 07' 2.80\" NA", "10 08' 2.80\" NA", "10 09' 2.80\" NA",
#> "10 10' 2.80\" NA")