Last chance! 50% off unlimited learning
Sale ends in
oceEdit(x, item, value, action,
reason="", person="", debug=getOption("oceDebug"))
oce
object. The exact action of oceEdit
depends
on the class
of x
; see class
"oce"
, altered
appropriately, and with a log item indicating the nature of the
alteration. 1. If both an item
and value
are supplied, then the
object's metadata entry named item
is updated to the
supplied value
.
2. If item
and value
are not supplied, then
action
must be supplied. This is a character string specifying
some action to be performed on the object, e.g. a manipulation of a
column. The action must refer to the object as x
; see
Examples.
3. Applied to an adv
object (i.e. data from an acoustic
velocimeter), oceEdit
treats items named heading
,
pitch
, roll
appropriately, depending on the type of
adv
instrument used. (This is necessary because different
manufacturers produce different forms of these items, i.e. Nortek
reports them on a time base that is different from the velocity
reporting, while Sontek reports them on the same time base.)
In each case, a log entry is stored in the object, to document the
change. Indeed, this is the main benefit to using this function,
instead of altering the object directly. The log entry will be most
useful if it contains a brief note on the reason
for the
change, and the name of the person
doing the work.
library(oce)
data(ctd)
ctd2 <- oceEdit(ctd, item="latitude", value=47.8879,
reason="illustration", person="Dan Kelley")
ctd3 <- oceEdit(ctd, action= "x@data$pressure <- x@data$pressure - 1")
Run the code above in your browser using DataLab