| oceSetData {oce} | R Documentation |
Set Something in the data Slot of an oce Object
Description
Create a copy of an object in which some element of its
data slot has been altered, or added.
Usage
oceSetData(object, name, value, unit, originalName, note = "")
Arguments
object |
an oce object. |
name |
String indicating the name of the |
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 |
Details
The trickiest argument to set is the unit. There are three
possibilities for this:
-
unitis a named or unnamedlist()that contains two items. If the list is named, the names must beunitandscale. If the list is unnamed, the stated names are assigned to the items, in the stated order. Either way, theunititem must be anexpression()that specifies the unit, and thescaleitem must be a string that describes the scale. For example, modern temperatures haveunit=list(unit=expression(degree*C), scale="ITS-90"). -
unitis anexpression()giving the unit as above. In this case, the scale will be set to"". -
unitis a character string that is converted into an expression with parse(text=unit), and the scale set to"".
Value
An oce object, the data slot of which has
been altered either by adding a new item or modifying an existing
item.
Author(s)
Dan Kelley
See Also
Other things related to the data slot:
oceDeleteData(),
oceGetData(),
oceRenameData()
Examples
data(ctd)
Tf <- swTFreeze(ctd)
ctd <- oceSetData(ctd, "freezing", Tf,
unit = list(unit = expression(degree * C), scale = "ITS-90")
)
plotProfile(ctd, "freezing")