Learn R Programming

growthTrendR (version 0.2.2)

read_rwl: Import raw ring-width measurements from the ITRDB

Description

Import raw ring-width measurements from the ITRDB

Usage

read_rwl(dir.src, rwl)

Value

A list with two elements:

  • header: a table containing site-level metadata

  • rwl: a table containing raw ring-width measurements

Arguments

dir.src

Character string specifying the directory path or URL where the RWL file is located. Users typically provide a local directory containing a user-downloaded ITRDB file, but an online source may also be used.

rwl

Character string giving the file name of the RWL file.

Details

The International Tree-Ring Data Bank (ITRDB) is maintained by the NOAA National Centers for Environmental Information (NCEI) as part of the World Data Service for Paleoclimatology. See: https://www.ncei.noaa.gov/products/paleoclimatology/tree-ring

Raw ring-width measurement files (`.rwl`) distributed through the ITRDB follow the *Tucson fixed-width format*. In this convention, header records encode site-level metadata (e.g., site identifier, site name, species code, geographic information, and temporal coverage), followed by ring-width measurements stored in a decadal layout (ten annual values per line).

Record 1

  • Columns 1--6: Site ID

  • Columns 10--61: Site name

  • Columns 62--65: Species code

  • Optional ID fields

Record 2

  • Columns 1--6: Site ID

  • Columns 10--22: State / country

  • Columns 23--30: Species

  • Columns 41--45: Elevation

  • Columns 48--57: Latitude--longitude

  • Columns 62--63: Measurement type code

  • Columns 68--76: First and last year

Latitude--longitude values are expressed in degrees and minutes (`ddmm` or `dddmm`).

Record 3

  • Columns 1--6: Site ID

  • Columns 10--72: Investigators

  • Columns 73--80: Optional completion date

Examples

Run this code
## Online example (not run to avoid timeout and internet dependency)
# \donttest{
dir.src <- "https://www.ncei.noaa.gov/pub/data/paleo/treering/measurements/northamerica/canada"
rwl <- "cana615.rwl"
dt.rwl <- read_rwl(dir.src, rwl)
# }

## Local example using packaged data
file <- system.file("extdata", "cana615.rwl", package = "growthTrendR")
stopifnot(file != "")
dir.src <- dirname(file)
rwl <- basename(file)
dt.rwl <- read_rwl(dir.src, rwl)

Run the code above in your browser using DataLab