Learn R Programming

oce (version 0.8-3)

as.coastline: Coerce data into coastline dataset

Description

Coerces a sequence of latitudes and longitudes into a coastline dataset.

Usage

as.coastline(latitude, longitude)

Arguments

latitude
the latitude in decimal degrees, positive north of the equator.
longitude
the longitude in decimal degrees, positive north of Greenwich.

Value

Details

This may be used when read.coastline cannot read a file, or when the data have been manipulated.

References

The NOAA site http://www.ngdc.noaa.gov/mgg/shorelines/shorelines.html is a good source for coastline data files.

See Also

The documentation for coastline-class explains the structure of coastline objects, and also outlines the other functions dealing with them.

Examples

Run this code
d<-read.table("bbasin.dat",header=FALSE) # dataset not provided with oce
HH <-c(1645:2105) # main outline of Halifax Harbour
GI <-c(4866:4885) # George's Island
coastlineHalifax <- as.coastline(latitude[c(HH,GI)],longitude[c(HH,GI)]-360)

Run the code above in your browser using DataLab