accessors {oce} | R Documentation

## Access or modify part of an Oce object

### Description

Access or modify part of an Oce object

### Usage

    conductivity(x) # whatever unit is in the object
    conductivity(x) <- value # sets conductivityunit to "ratio"
    elevation(x, time)
    distance(x, time)
    heading(x, time)
    heading(x) <- value
    latitude(x, time, byDepth=TRUE)
    latitude(x) <- value
    longitude(x, time, byDepth=TRUE)
    longitude(x) <- value
    pitch(x, time)
    pitch(x) <- value
    pressure(x, time)
    pressure(x) <- value
    roll(x, time)
    roll(x) <- value
    salinity(x, time)
    salinity(x) <- value
    sigmaTheta(x, time)
    sigmaTheta(x) <- value
    temperature(x, time)
    temperature(x) <- value
    oxygen(x, time)
    oxygen(x) <- value
    nitrate(x, time)
    nitrate(x) <- value
    nitrite(x, time)
    nitrite(x) <- value
    phosphate(x, time)
    phosphate(x) <- value
    silicate(x, time)
    silicate(x) <- value
    spice(x, time)
    tritium(x, time)
    time(x)
    velocity(x)

### Arguments

`x` | an `oce` object.
`time` | optional vector of POSIX times, or object the `data` slot of which contains times in a field named `time` or `timeSlow`. (If this argument is not provided, missing, values at all the times in `x` are returned.)
`byDepth` | flag usd only for `"section"` objects, which indicates whether to repeat the `longitude` or `latitude` values so that there is a value for each depth in each profile.
`value` | value to assign to the relevant item in the `x` object.

### Details

Normally, users should access elements within `oce` objects using the double bracket notation, e.g. if `x` is an object of `ctd-class`, then `x[["salinity"]]` refers to the salinity, either as a value to be retrieved or one to be set.

The accessor functions referred to above prove another way to access `oce` data. This is much more limited and are not generally recommended; they are included mainly so that old code will still work.

### Value

Value of indicated portion of `x`.

### Author(s)

Dan Kelley

### See Also

Individual object classes handle accessing in specialized ways; see e.g. `ctd-class` for how `[[` works for CTD objects.

### Examples

    library(oce)
    data(adp)
    print(heading(adp))
    heading(adp) <- 5 + heading(adp) # add 5 degrees to the heading
    print(heading(adp))

[Package oce version 0.9-18 Index]