Learn R Programming

oce (version 1.8-3)

subset,amsr-method: Subset an amsr Object

Description

Return a subset of a amsr object.

Usage

# S4 method for amsr
subset(x, subset, ...)

Value

An amsr object.

Arguments

x

an amsr object.

subset

an expression indicating how to subset x.

...

ignored.

Author

Dan Kelley

Details

This function is used to subset data within an amsr object by longitude or by latitude. These two methods cannot be combined in a single call, so two calls are required, as shown in the Example.

See Also

Other things related to amsr data: [[,amsr-method, [[<-,amsr-method, amsr, amsr-class, composite,amsr-method, download.amsr(), plot,amsr-method, read.amsr(), summary,amsr-method

Other functions that subset oce objects: subset,adp-method, subset,adv-method, subset,argo-method, subset,cm-method, subset,coastline-method, subset,ctd-method, subset,echosounder-method, subset,lobo-method, subset,met-method, subset,oce-method, subset,odf-method, subset,rsk-method, subset,sealevel-method, subset,section-method, subset,topo-method, subset,xbt-method

Examples

Run this code
library(oce)
data(amsr) # see ?amsr for how to read and composite such objects
sub <- subset(amsr, -75 < longitude & longitude < -45)
sub <- subset(sub, 40 < latitude & latitude < 50)
plot(sub)
data(coastlineWorld)
lines(coastlineWorld[["longitude"]], coastlineWorld[["latitude"]])

Run the code above in your browser using DataLab