Create a section based on columnar data, or a set of oce objects that can be coerced to a section. There are three cases.
1 2 3 4 5 6 7 8 9
This may be a numerical vector, in which case it is interpreted as the salinity, and the other arguments are used for the other components of ctd objects. Alternatively, it may be one of a variety of other objects from which the CTD objects can be inferred, in which case the other arguments are ignored; see ‘Details’.
Temperature, in a vector holding values for all stations.
Pressure, in a vector holding values for all stations.
Longitude, in a vector holding values for all stations.
Latitude, in a vector holding values for all stations.
Station identifiers, in a vector holding values for all stations.
Case 1. If the first argument is a numerical vector, then it is taken to be the
factor() is applied to
station to break the
data up into chunks that are assembled into ctd objects with
as.ctd() and combined to make a section object
to be returned. This mode of operation is provided as a convenience for datasets
that are already partly processed; if original CTD data are available, the next
mode is preferred, because it permits the storage of much more data and metadata
in the CTD object.
Case 2. If the first argument is a list containing oce objects, then those
objects are taken as profiles of something. A requirement for this
to work is that every element of the list contains both
latitude in either the
data slot (in
the latter case, the mean value is recorded in the section object)
and that every element also contains
pressure in its
Case 3. If the first argument is a argo object, then the profiles it contains are turned into ctd objects, and these are assembled into a section to be returned.
An object of section.
Other things related to section data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
library(oce) data(ctd) ## vector of names of CTD objects fake <- ctd fake[["temperature"]] <- ctd[["temperature"]] + 0.5 fake[["salinity"]] <- ctd[["salinity"]] + 0.1 fake[["longitude"]] <- ctd[["longitude"]] + 0.01 fake[["station"]] <- "fake" sec1 <- as.section(c("ctd", "fake")) summary(sec1) ## vector of CTD objects ctds <- vector("list", 2) ctds[] <- ctd ctds[] <- fake sec2 <- as.section(ctds) summary(sec2) ## argo data (a subset) data(argo) sec3 <- as.section(subset(argo, profile<5)) summary(sec3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.