Learn R Programming

oce (version 0.9-18)

subset.coastline: Subset a coastline object

Description

Subset a coastline object

Usage

## S3 method for class 'coastline':
subset(x, subset, \dots)

Arguments

x
a coastline object.
subset
a condition to be applied to the data portion of x. See Details.
...
ignored.

Value

  • A new coastline object.

Details

This function is somewhat analogous to subset.data.frame. Points on the coastline that are outside the subset region are set to NA. If the results are to be plotted with plot.coastline, it will be necessary to set the argument fill=NULL to avoid filling land areas.

Examples

Run this code
library(oce)
data(coastlineWorld)
plot(coastlineWorld)
a <- subset(coastlineWorld, longitude < 0)
points(a[['longitude']], a[['latitude']], col='red', pch=20, cex=1/2)

Run the code above in your browser using DataLab