Learn R Programming

dplR (version 1.8.0)

read.rwl: Read Ring Width File

Description

This function reads in a file of ring widths (.rwl) in one of the available formats.

Usage

read.rwl(fname,
         format = c("auto", "tucson", "compact", "tridas", "heidelberg",
                    "sheet", "csv"),
         ...)

Value

If a "tucson", "compact", "heidelberg", "sheet" file is read (even through "auto"), returns an object of class

c("rwl", "data.frame") with the series in columns and the years as rows. The series IDs are the column names and the years are the row names.

If a "tridas" file is read (even through "auto"), returns a list of results. See read.tridas for more information.

Arguments

fname

a character vector giving the file name of the rwl file.

format

a character vector giving the format. This must be "auto" (rough automatic detection), "tucson", "compact", "tridas", "heidelberg" or "sheet". "csv" is accepted as a synonym for "sheet". Automatic format detection is the default but failable.

...

arguments specific to the function implementing the operation for the chosen format.

Author

Mikko Korpela

Details

This is a simple wrapper to the functions actually implementing the read operation.

With format = "auto" the file's first lines are scanned and the most specific match wins: a DPL compact column specification or a HEADER: line, then a <tridas> element, then a NOAA/NCEI template header, then a comma separated sheet, and Tucson if nothing else matches. A sheet is recognised by every line splitting into the same number of comma separated fields, not by the presence of a comma. Only commas are looked for: a tab separated file may be a NOAA template, so tab separated sheets need format = "sheet" with a sep argument.

format = "sheet" is handled by read.sheet, which as of dplR 1.8.0 replaces the deprecated csv2rwl. Files that csv2rwl accepted may now be refused; see read.sheet.

"csv" is accepted as a synonym for "sheet" because it has been a valid value of format since before read.sheet existed. It is the less accurate of the two: read.sheet also reads tab, semicolon and pipe separated files, so format = "sheet" with a sep argument is an ordinary call. Prefer "sheet" in new code.

See Also

read.tucson, read.tucson.legacy, read.compact, read.tridas, read.fh, read.sheet, write.rwl