ctd.add.column {oce}R Documentation

Add a column to a CTD file

Description

Add a column to a ctd file, updating the header as appropriate.

Usage

ctd.add.column(x, column, name, label, debug=FALSE)

Arguments

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.

Details

These functions add the column to the the data frame in the the object.

Value

An object of class "ctd", with a new column.

Note

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.

Author(s)

Dan Kelley

See Also

See read.ctd for the data format.

Examples

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")

[Package oce version 0.1-80 Index]