Learn R Programming

oce (version 0.9-20)

ctdAddColumn: Add a Column to the Data Slot of a CTD Object [deprecated]

Description

WARNING: This function will be removed soon; see oce-deprecated. Use oceSetData instead of the present function.

Usage

ctdAddColumn(x, column, name, label, unit = NULL, log = TRUE, originalName = "", debug = getOption("oceDebug"))

Arguments

x
A ctd object, i.e. one inheriting from ctd-class.
column
A column of data to be inserted, in the form of a numeric vector, whose length matches that of columns in the objecct.
name
Character string indicating the name this column is to have in the data slot of x.
label
Optional character string or expression indicating the name of the column, as it will appear in plot labels. (If not given, name will be used.)
unit
Optional indication of the unit, in the form of a list containing items unit, which is an expression, and scale, which is a character string. For example, modern measurements of temperature have unit list(name=expression(degree*C), scale="ITS-90").
log
A logical value indicating whether to store an entry in the processing log that indicates this insertion.
originalName
string indicating the name of the data element as it was originally. This makes sense only for data being read from a file, where e.g. WOCE or SBE names might be used.
debug
an integer specifying whether debugging information is to be printed during the processing. This is a general parameter that is used by many oce functions. Generally, setting debug=0 turns off the printing, while higher values suggest that more information be printed.

Value

A ctd object.

Details

Add a column to the data slot of an object of ctd-class, also updating the metadata slot as appropriate.

See Also

The documentation for ctd-class explains the structure of CTD objects, and also outlines the other functions dealing with them.

Other functions that will be removed soon: addColumn, ctdUpdateHeader, mapMeridians, mapZones

Examples

Run this code
library(oce)
data(ctd)
F <- 32 + (9/5)*ctd[["temperature"]]
ctdNew <- ctdAddColumn(ctd, F, "temperatureF",
    unit=list(unit=expression(degree*F), scale="ITS-90"))

Run the code above in your browser using DataLab