Learn R Programming

mapmisc (version 2.1.0)

gridlinesWrap: Adds long-lat grid for projected data

Description

long-lat grid lines are added to a map in the coordinate system specified, allowing for map projections wrapped differently from the 180 meridian.

Usage

gridlinesWrap(crs, 
		easts=seq(-180,180,by=60),
		norths=seq(-90,90,by=30),
		ndiscr=40, plotLines=TRUE, 
		plotLabels = TRUE, ...)

Value

A list with elements lines, containg the graticule lines, and points containing the locations and labels for longitude and latitude values.

Arguments

crs

A character string representing a CRS

easts

vector of longitudes

norths

vector of latitudes

ndiscr

number of intermediate points per line

plotLines

add lines to existing plot

plotLabels

add labels to existing plot

...

Additional arguments passed to lines or text, for example lty=2

Author

Patrick Brown

See Also

graticule

Examples

Run this code
data('worldMap')
worldMap = terra::unwrap(worldMap)
crsMoll = moll(-100)
worldMapT = wrapPoly(worldMap, crsMoll, buffer.width=200*1000)

plot(attributes(crsMoll)$ellipse)
plot(worldMapT, add=TRUE)
gridlinesWrap(crsMoll, lty=3, col='red', cex=0.6)


Run the code above in your browser using DataLab