as.ctd(salinity, temperature, pressure,
oxygen, nitrate, nitrite, phosphate, silicate,
scan, other,
missingValue,
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 ar1:length(salinity).NA.quality=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.ctd-class explains the structure
of CTD objects, and also outlines the other functions dealing with them.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