Learn R Programming

oce (version 0.9-19)

addColumn: Add a Column to the Data Slot of an Oce object

Description

If there is already a column with the given name, its contents are replaced by the new value.

Usage

addColumn(x, data, name)

Arguments

x
A ctd object, e.g. as read by read.ctd.
data
the data. The length of this item must match that of the existing data entries in the data slot).
name
the name of the column.

Value

An object of class oce, with a new column.

See Also

ctdAddColumn does a similar thing for ctd objects, and is in fact called, if x is of class ctd.

Examples

Run this code
library(oce)
data(ctd) 
st <- swSigmaTheta(ctd[["salinity"]], ctd[["temperature"]], ctd[["pressure"]])
new <- addColumn(ctd, st, "sigmaTheta")

Run the code above in your browser using DataLab