Learn R Programming

oce (version 0.9-5)

mapLines: Plot lines on a existing map

Description

Plot lines on an existing map

Usage

mapLines(longitude, latitude, greatCircle=FALSE, ...)

Arguments

longitude
longitudes of points to be plotted
latitude
latitudes of points to be plotted
greatCircle
boolean indicating whether to render line segments as great circles. (Ignored at present.)
...
optional arguments passed to lines.

Bugs

This should use approx to fill in multiple segments within the line, so that e.g. great circle lines will be curved.

Details

Adds lines to an existing map, by analogy to lines.

See Also

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

Examples

Run this code
library(oce)
data(coastlineWorld)
longitude <- coastlineWorld[['longitude']]
latitude <- coastlineWorld[['latitude']]
mapPlot(longitude, latitude, type='l',
        longitudelim=c(-80,10), latitudelim=c(0,120),
        projection="orthographic", orientation=c(45,-100,0))
lon <- c(-63.5744, 0.1062)             # Halifax CA to London UK
lat <- c(44.6479, 51.5171)
mapLines(lon, lat, col='red')

Run the code above in your browser using DataLab