oceSetData {oce}R Documentation

Set something in the data slot of an oce object

Description

Set something in the data slot of an oce object

Usage

oceSetData(object, name, value, unit, originalName, note = "")

Arguments

object

an oce object

name

String indicating the name of the item to be set.

value

Value for the item.

unit

An optional indication of the units for the item. This has three possible forms (see “Details”).

originalName

Optional character string giving an 'original' name (e.g. as stored in the header of a data file).

note

Either empty (the default), a character string, or NULL, to control additions made to the processing log of the return value. If note="" then the an entry is created based on deparsing the function call. If note is a non-empty string, then that string gets added added to the processing log. Finally, if note=NULL, then nothing is added to the processing log. This last form is useful in cases where oceSetData is to be called many times in succession, resulting in an overly verbose processing log; in such cases, it might help to add a note by e.g. processingLog(a) <- "QC (memo dek-2018-01/31)"

Details

There are three possibilities for unit:

Examples

data(ctd)
Tf <- swTFreeze(ctd)
ctd <- oceSetData(ctd, "freezing", Tf, list(unit=expression(degree*C), scale="ITS-90"))
feet <- swDepth(ctd) / 0.3048
ctd <- oceSetData(ctd, name="depthInFeet", value=feet, expression("feet"))
fathoms <- feet / 6
ctd <- oceSetData(ctd, "depthInFathoms", fathoms, "fathoms")

[Package oce version 1.0-1 Index]