read_sbe_cnv: Read Seabird .cnv files

Description Usage Arguments Examples

View source: R/read-sbe-cnv.R

Description

The .cnv file format is the primary file format used for input and output to SBE Data Processing. The format is essentially a fixed-width format using 11 characters for each column.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
read_sbe_cnv(
  file,
  skip = 0,
  n_max = Inf,
  header = read_sbe_header(file),
  col_names = read_sbe_cnv_colmeta(file, header)$name,
  widths = rep(11L, length(col_names))
)

read_sbe_cnv_colmeta(file, header = read_sbe_header(file))

read_sbe_header(file, n_header = 500)

Arguments

file

A file, URL, or connection. Files ending in .gz, .bz2, .xz, or .zip will be automatically uncompressed; URLs will be automatically downloaded. See readr::read_lines() for a full description of how this parameter is interpreted.

skip

Number of non-header rows to skip.

n_max

Maximum number of rows to read.

header

A previously read value obtained from read_sbe_header().

col_names

The column names. Defaults to the name column of read_sbe_cnv_colmeta().

widths

A vector the same length as col_names denoting the widths of each field in characters. Defaults to 11.

n_header

The starting guess for number of header lines.

Examples

1
2
3
4
5
6
7
8
file <- system.file("extdata/faroe/faroe.cnv", package = "sbe")
read_sbe_cnv(file)
read_sbe_cnv_colmeta(file)
head(read_sbe_header(file))

# header information is kept on read with the 'header' attribute
cnv <- read_sbe_cnv(file)
head(attr(cnv, "header"))

paleolimbot/sbe documentation built on Dec. 31, 2020, 1:13 a.m.