Learn R Programming

oce (version 0.9-18)

mapLongitudeLatitudeXY: Convert from longitude and latitude to x and y

Description

Find (x,y) values corresponding to (longitude, latitude) values, using the present projection.

Usage

mapLongitudeLatitudeXY(longitude, latitude)

Arguments

longitude
longitudes of points, or an object from which latitude and longitude can be inferred (e.g. a coastline file, or the return value from mapLocator), in which case the following two
latitude
latitudes of points, needed only if they cannot be inferred from from the first argument

Value

  • A list containing x and y.

Details

This is mainly a wrapper around lonlat2map.

See Also

See mapPlot for general information on plotting maps, including other functions.

Examples

Run this code
library(oce)
data(coastlineWorld)
par(mfrow=c(2,1), mar=rep(2, 4))
mapPlot(coastlineWorld, projection="+proj=moll") # sets a projection
xy <- mapLongitudeLatitudeXY(coastlineWorld)
plot(xy, type='l', asp=1)

Run the code above in your browser using DataLab