oceEdit: Edit an Oce Object

Description Usage Arguments Details Value Author(s) Examples

View source: R/oce.R

Description

Edit an element of an oce object, inserting a note in the processing log of the returned object.

Usage

1
2
oceEdit(x, item, value, action, reason = "", person = "",
  debug = getOption("oceDebug"))

Arguments

x

an oce object. The exact action of oceEdit depends on the class of x.

item

if supplied, a character string naming an item in the object's metadata or data slot, the former being checked first. An exception is if item starts with "[email protected]" or "[email protected]", in which case the named slot is updated with a changed value of the contents of item after the @ character.

value

new value for item, if both supplied.

action

optional character string containing R code to carry out some action on the object.

reason

character string giving the reason for the change.

person

character string giving the name of person making the change.

debug

an integer that specifies a level of debugging, with 0 or less indicating no debugging, and 1 or more indicating debugging.

Details

There are several ways to use this function.

In any 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.

Value

An object of class "oce", altered appropriately, and with a log item indicating the nature of the alteration.

Author(s)

Dan Kelley

Examples

1
2
3
4
5
library(oce)
data(ctd)
ctd2 <- oceEdit(ctd, item="latitude", value=47.8879,
               reason="illustration", person="Dan Kelley")
ctd3 <- oceEdit(ctd,action="[email protected]$pressure<[email protected]$pressure-1")

oce documentation built on Oct. 4, 2018, 5:04 p.m.