as.ctd(salinity, temperature, pressure, quality,
ship="", scientist="", institute="", address="", cruise="", station="",
date="", startTime="", recovery="",
latitude=NA, longitude=NA,
waterDepth=NA, sampleInterval=NA, src="")salinity, temperature, and
pressure, in which case these values are extracted from the
data frame, and the next two arguments arquality=2 indicates good data,
quality=3 means questionable data, and quality=4
means bad data.ctd object, e.g. so that
plot.ctd can be used to make a standard four-panel plot,
or so that a section can be constructed with
makeSection. Normally, the input vectors will be of
the same length, but as.ctd can also handle cases in which one
or two of these is of unit length. For example, if only a temperature
profile is available, as.ctd(35, T, p) could be used to
construct a ctd object with constant salinity.read.ctd. A ctd object may be summarized with
summary.ctd. Overview plots may be made with
plot.ctd, while plot.TS produces TS plots
and plot.ctd.scan produces scan plots that may help with
data editing. Extraneous data such as those collected during upcasts
and equilibration intervals may be trimmed with
ctdTrim, and the data may be cast onto specified
pressure levels with ctdDecimate. Low-level
manipulation may be done with ctdAddColumn and
ctdUpdateHeader, as well as by direct manipulation of
the items within ctd objects.library(oce)
pressure <- 1:50
temperature <- 10 - tanh((pressure - 20) / 5) + 0.02*rnorm(50)
salinity <- 34 + 0.5*tanh((pressure - 20) / 5) + 0.01*rnorm(50)
ctd <- as.ctd(salinity, temperature, pressure)
summary(ctd)
plot(ctd)Run the code above in your browser using DataLab