Hadoop Online Training by Edureka

oceSetData: Set something in the 'data' slot of an 'oce' object

Description Usage Arguments Details Examples

Description

Set something in the data slot of an oce object

Usage

1
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

A note to be stored in the processing log. If an empty string (the default) then an entry will be constructed from the function call. If NULL, then no entry will be added to the processing log.

Details

There are three possibilities for unit:

  • Case 1. unit is a named or unnamed list that contains two items. If the list is named, the names must be unit and scale. If the list is unnamed, the stated names are assigned to the items, in the stated order. Either way, the unit item must be an expression that specifies the unit, and the scale item must be a string that describes the scale. For example, modern temperatures have unit=list(unit=expression(degree*C), scale="ITS-90").

  • Case 2. unit is an expression giving the unit as above. In this case, the scale will be set to "".

  • Case 3. unit is a character string that is converted into an expression with parse(text=unit), and the scale set to "".

Examples

1
2
3
4
5
6
7
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")


Search within the oce package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.