Learn R Programming

MtreeRing (version 1.1)

calcRingWidth: Generate a ring-width series

Description

This function can calculate the ring-width series according to detected ring borders.

Usage

calcRingWidth(ring.data, seriesID)

Arguments

ring.data

A matrix or array produced by autoDetect or visualSelect.

seriesID

A character string specifying the column name of the ring-width series.

Value

A data frame. The series ID is the column name and years are row names.

Examples

Run this code
# NOT RUN {
## Find the image file name in package MtreeRing:
img.name <- system.file("001.png", package = "MtreeRing")

## Read and plot the image:
t1 <- imgInput(img = img.name, dpi = 1200)

## Split a long core sample into 3 pieces to
## get better display performance and use the
## watershed algorithm to detect ring borders:
t2 <- autoDetect(ring.data = t1, seg = 3, method = 'watershed')

## Calculate ring widths from the attribute list of t2:
rw.df <- calcRingWidth(ring.data = t2, seriesID = "940220")

# }

Run the code above in your browser using DataLab