oceAddData {oce} | R Documentation |
Add, alter, get, or delete data or metadata items.
oceGetData(object, name, default=NA) oceDeleteData(object, name) oceSetData(object, name, value, units, note="") oceGetMetadata(object, name, default=NA) oceDeleteMetadata(object, name) oceSetMetadata(object, name, value, note="")
object |
An oce object. |
name |
Name of the desired item. |
value |
Value for the named item. |
units |
Optional |
default |
A default value to be returned if |
note |
A note to be inserted in the processing log, in addition to an automatically-constructed note. |
In providing access to the data
and metadata
slots of an
object, these functions are similar to direct access, e.g. in
x <- oceSetMetadata(x, "latitude", 45) x@metadata$latitude <- 45
the first has the advantage of adding useful notes to the
processingLog
. The delete
functions also update the log.
For set
and delete
functions, the updated object is
returned. For the get
functions, the named item is returned.
library(oce) data("ctd") oceGetMetadata(ctd, "latitude") ctd <- oceSetMetadata(ctd, "latitude", 45, "We like round numbers") summary(ctd)