The function was written by inspection of a particular file, and might be wrong for other files; see “Details” for a note on character translation.

  longitude = NA,
  latitude = NA,
  debug = getOption("oceDebug"),



a connection or a character string giving the name of the file to load.


optional signed number indicating the longitude in degrees East.


optional signed number indicating the latitude in degrees North.


a flag that turns on debugging. The value indicates the depth within the call stack to which debugging applies.


if provided, the action item to be stored in the log. This parameter is typically only provided for internal calls; the default that it provides is better for normal calls by a user.


An xbt object.


The header is converted to ASCII format prior to storage in the metadata slot, so that e.g. a degree sign in the original file will become a ? character in the header. This is to prevent problems with submission of oce to the CRAN system, which produces NOTEs about UTF-8 strings in data (on some build machines, evidently depending on the locale on those machines). This character substitution is at odds with the oce philosophy of leaving data intact, so it will be reverted, if CRAN policy changes or if the developers can find a way to otherwise silence the NOTE.


library(oce) xbt <- read.oce(system.file("extdata", "xbt.edf", package="oce")) summary(xbt)
#> xbt summary #> ----------- #> #> * File source: "/private/var/folders/rx/k1x_t_q12zb9hbjr4ldxmjc80000gn/T/RtmpjZN348/temp_libpath17c45663e6dd0/oce/extdata/xbt.edf" #> * Serial Number: 0 #> * Longitude: 4.005 #> * Latitude: -4 #> * Time: 2000-10-10 08:49:38 #> * Data Overview #> #> Min. Mean Max. Dim. NAs OriginalName #> depth [m] 5.4 7.0333 8.7 6 0 Depth #> temperature [°C, ITS-90] 20.9 20.905 20.91 6 0 Temperature #> soundSpeed [m/s] 1575.3 1575.3 1575.4 6 0 Sound Velocity #> #> * Processing Log #> #> - 2020-07-21 16:52:07 UTC: `create 'xbt' object` #> - 2020-07-21 16:52:07 UTC: `read.xbt.edf(file = file)`