Return a subset of a amsr object.

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

Arguments

x

an amsr object.

subset

an expression indicating how to subset x.

...

ignored.

Value

An amsr object.

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.

Author

Dan Kelley

Examples

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"]])