Learn R Programming

measuRing (version 0.5.1)

ringWidths: Ring widths

Description

This function can compute the ring widths (mm) from the ring borders detected on an image section.

Usage

ringWidths(image, last.yr = NULL, 
    ...)

Value

data frame with the ring widths.

Arguments

image

character or matrix. Either path of an image section or an array representing a gray matrix.

last.yr

year of formation of the newest ring. If NULL then the rings are numbered from one (right) to the number of detected rings (left).

...

arguments to be passed to two functions: ringBorders, and/or imageTogray.

Author

Wilson Lara <wilarhen@gmail.com> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Carlos Sierra [aut] (<https://orcid.org/0000-0003-0009-4169>), Felipe Bravo [aut] (<https://orcid.org/0000-0001-7348-6695>)

Examples

Run this code
## (not run) Read one image section:
image1 <- system.file("P105_a.tif", package="measuRing")       
## (not run) columns in gray matrix to be included/excluded:
Toinc <- c(196,202,387,1564) 
Toexc <- c(21,130,197,207,1444,1484)
## (not run) tree-ring widths
rwidths <- ringWidths(image1,inclu = Toinc,exclu = Toexc,last.yr=NULL)
str(rwidths)
##plot of computed tree-ring widths:
maint <- 'Hello ring widths!'
plot(rwidths,type='l',col = 'red',main = maint,
     xlab = 'Year',ylab = 'Width (mm)')    

Run the code above in your browser using DataLab