Learn R Programming

oce (version 0.1-76)

add.column: Add a column to an oce object

Description

Add a column to an oce object's data.

Usage

add.column(x, data, name)

Arguments

x
A ctd object, e.g. as read by read.ctd.
data
the data (length must match length of columns in existing x$data data frame).
name
the name of the column.

Value

  • An object of class oce, with a new column.

Details

The header is unchanged by this operation.

See Also

add.ctd.column does a similar thing for ctd objects.

Examples

Run this code
library(oce)
data(ctd) 
sigthe <- sw.sigma.theta(ctd$data$salinity,
	ctd$data$temperature,
	ctd$data$pressure);
new <- add.column(ctd, sigthe, "sigmatheta")

Run the code above in your browser using DataLab