as.cm: Coerce data into a CM object

Description Usage Arguments See Also Examples

View source: R/cm.R

Description

Coerce data into a CM object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
as.cm(
  time,
  u = NULL,
  v = NULL,
  pressure = NULL,
  conductivity = NULL,
  temperature = NULL,
  salinity = NULL,
  longitude = NA,
  latitude = NA,
  filename = "",
  debug = getOption("oceDebug")
)

Arguments

time

A vector of times of observation, or an oce object from which time and two velocity components can be inferred, e.g. an adv object, or an adp object that has only one distance bin. If time is an oce object, then all of the following arguments are ignored.

u, v

optional numerical vectors containing the x and y components of velocity (m/s).

pressure, conductivity, salinity, temperature

optional numerical vectors containing pressure (dbar), electrical conductivity, practical salinity, and in-situ temperature (degree C).

longitude, latitude

optional position specified in degrees East and North.

filename

optional source file name.

debug

an integer specifying whether debugging information is to be printed during the processing. This is a general parameter that is used by many oce functions. Generally, setting debug=0 turns off the printing, while higher values suggest that more information be printed. If one function calls another, it usually reduces the value of debug first, so that a user can often obtain deeper debugging by specifying higher debug values.

See Also

Other things related to cm data: [[,cm-method, [[<-,cm-method, cm-class, cm, plot,cm-method, read.cm(), rotateAboutZ(), subset,cm-method, summary,cm-method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(oce)
# Example 1: creation from scratch
t <- Sys.time() + 0:50
u <- sin(2*pi*0:50/5) + rnorm(51)
v <- cos(2*pi*0:50/5) + rnorm(51)
p <- 100 + rnorm(51)
summary(as.cm(t, u, v, p))

# Example 2: creation from an adv object
data(adv)
summary(as.cm(adv))

dankelley/oce documentation built on April 8, 2021, 3:47 a.m.