Learn R Programming

dplR (version 1.5.3)

read.ids: Read Site-Tree-Core IDs

Description

This function tries to read site, tree, and core IDs from a rwl data.frame.

Usage

read.ids(rwl, stc = c(3, 2, 3))

Arguments

rwl
a data.frame with series as columns and years as rows such as that produced by read.rwl or ca533
stc
a vector of three integral values summing to eight. These indicate the number of characters to split the site code (stc[1]), the tree IDs (stc[2]), and the core ID<

Value

  • A data.frame with column one named "tree" giving a numeric ID for each tree and column two named "core" giving a numeric ID for each core. The original series IDs are copied from rwl as rownames. The order of the rows in the output matches the order of the series in rwl.

Details

Because dendrochronologists often take more than one core per tree, it is occasionally useful to calculate within vs. between tree variance. The International Tree Ring Data Bank (ITRDB) allows the first eight characters in an rwl file for series IDs but these are often shorter. Typically the creators of rwl files use a logical labeling method that can allow the user to determine the tree and core ID from the label. Argument stc tells how each series separate into site, tree, and core IDs. For instance a series code might be "ABC011" indicating site "ABC", tree 1, core 1. If this format is consistent then the stc mask would be c(3, 2, 3) allowing up to three characters for the core ID (i.e., pad to the right). If it is not possible to define the scheme (and often it is not possible to machine read IDs), then the output data.frame can be built manually. See below for format. The function attempts to convert the tree and core substrings to integers. When this succeeds, the converted values are copied to the output without modification. When non-integral substrings are observed, each unique tree substring is assigned an integral value in the range 1 to n, where n is the number of unique tree substrings. The same applies to cores within a tree. Substrings are sorted before assigning the numeric IDs. The order of columns in rwl does not affect the tree and core IDs assigned to each series.

See Also

rwi.stats, read.rwl

Examples

Run this code
data(ca533)
read.ids(ca533, stc = c(3, 2, 3))

Run the code above in your browser using DataLab