[[,glider-method | R Documentation |
Retrieve something contained in a glider object, or something that can be computed from what is contained there.
## S4 method for signature 'glider'
x[[i, j, ...]]
x |
a glider object, i.e. one inheriting from glider. |
i |
a character value that names the item to be retrieved. |
j |
an optional character value specifying the data-stream to be used. |
... |
optional additional information (ignored). |
First, a check is done to see if the object's metadata contains an item
with name given by i
. If this is true, then that value is returned.
Otherwise, the item is sought somewhere within the data
slot.
This may be done within data
directly for Slocum
data or within data$payload
or a similar name for SeaExplorer
data. Note that [[
can retrieve not just the actual stored
information, but also information that can be derived from that information.
For example, gliders do not store Absolute Salinity or Conservative
Temperature, but they can be retrieved with g[["SA"]]
and g[["CT"]]
respectively, where g
is a glider object (see Example 1). Use e.g. g[["?"]]
on
a given glider object, to find out what items [[
can retrieve
(see Example 2).
Dan Kelley
library(oceglider)
directory <- system.file("extdata/sea_explorer/delayed_raw", package = "oceglider")
g <- read.glider.seaexplorer.raw(directory, pattern = "pld1.raw")
# Example 1: look up Absolute Salinity
summary(g[["SA"]])
# Example 2: discover what can be retrieved from this object
# (FIXME: not all of these work)
g[["?"]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.