accessors {oce} | R Documentation |
Access or modify part of an Oce object
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)
x |
an |
time |
optional vector of POSIX times, or object the |
byDepth |
flag usd only for |
value |
value to assign to the relevant item in the |
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 of indicated portion of x
.
Dan Kelley
Individual object classes handle accessing in specialized ways; see
e.g. ctd-class
for how [[
works for CTD objects.
library(oce) data(adp) print(heading(adp)) heading(adp) <- 5 + heading(adp) # add 5 degrees to the heading print(heading(adp))