Read an oceanographic data file, auto-discovering the file type from the
first line of the file.
This function tries to infer the file type from the first line, using
oceMagic(). If it can be discovered, then an
instrument-specific file reading function is called, with the
and with any additional arguments being supplied.
read.oce(file, ..., encoding = "latin1")
a connection or a character string giving the name of the file to load.
arguments to be handed to whichever instrument-specific reading function is selected, based on the header.
a character string giving the file encoding. This defaults
"latin1", which seems to work for files available to the authors, but
be aware that a different setting may be required for files that contain
unusual accents or characters. (Try
"UTF-8" if the default produces
errors.) Note that
encoding is ignored in binary files, and also
in some text-based files, as well.
library(oce) x <- read.oce(system.file("extdata", "ctd.cnv", package="oce")) #> Warning: startTime (1903-10-15 11:38:38) is < 1950, suggesting a turn-of-the-century problem in this cnv file #> Warning: this CNV file has temperature in the IPTS-68 scale and this is stored in the object, but note that [["temperature"]] and the sw* functions convert the numbers to ITS-90 values plot(x) # summary with TS and profiles plotTS(x) # just the TS