ctd.add.column {oce} | R Documentation |
Add a column to a ctd
file, updating the header as appropriate.
ctd.add.column(x, column, name, label, debug=FALSE)
x |
A ctd object, e.g. as read by read.ctd . |
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 dataframe. For example, using
name="hello" in the creation of d would mean
that the data could be accessed as d$data$hello or
d$data[["hello"]] . |
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.) |
debug |
Set TRUE to see information about the processing. |
These functions add the column to the the data frame in the the object.
An object of class
"ctd"
, with a new column.
Note that the arguments to this function were changed in version 0.1.77 of the package, in order to remove confusion about their function, and in order to make the function better able to deal with a wider range of CTD devices.
Dan Kelley
See read.ctd
for the data format.
library(oce) data(ctd) SS <- ctd$data$salinity^2 ctd.new <- ctd.add.column(ctd, SS, "ss", expression(paste(S^2, " [", PSU^2, " ]"))) plot.profile(ctd.new, "ss")