Learn R Programming

oce (version 0.9-18)

extract: Extract data from an oce object

Description

Extract data from an oce object

Usage

extract(x, names)

Arguments

x
an oce object.
names
a vector of character values, indicating names of items to be extracted.

Value

  • A list of the values found.

Details

This is a convenience function that extracts data from an oce object, providing the user with isolation from the internal storage scheme used in oce objects.

Examples

Run this code
library(oce)
## ctd cast
data(ctd)
TS <- extract(ctd, c("temperature", "salinity"))
print(summary(lm(temperature~salinity, data=TS)))

## section
data(section)
TSlon <- extract(section, c("temperature","salinity","pressure","longitude"))
med <- factor(-20 > TSlon$longitude, labels=c("med","other"))
plotTS(TSlon, col=c("black","gray")[med])

Run the code above in your browser using DataLab