sub-sub-glider-method: Retrieve Part of a glider Object

[[,glider-methodR Documentation

Retrieve Part of a glider Object

Description

Retrieve something contained in a glider object, or something that can be computed from what is contained there.

Usage

## S4 method for signature 'glider'
x[[i, j, ...]]

Arguments

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).

Details

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).

Author(s)

Dan Kelley

Examples

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[["?"]]


dankelley/oceanglider documentation built on June 8, 2025, 4:20 a.m.