ctdAddColumn {oce} | R Documentation |
Add a column to the data
slot of an object of
ctd-class
, also updating the metadata
slot as appropriate.
ctdAddColumn(x, column, name, label, unit = NULL, debug = getOption("oceDebug"))
x |
A |
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 |
label |
Optional character string or expression indicating the
name of the column, as it will appear in plot labels. (If not
given, |
unit |
Optional indication of the unit, in the form of a list containing
items |
debug |
A debugging flag; set this to a positive value to get debugging information during processing. |
A ctd object.
The documentation for ctd-class
explains the structure
of CTD objects, and also outlines the other functions dealing with them.
library(oce) data(ctd) F <- 32 + (9/5)*ctd[["temperature"]] ctdNew <- ctdAddColumn(ctd, F, "temperatureF", unit=list(unit=expression(degree*F), scale="ITS-90"))