ringWidths: Ring widths

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

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

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.

Value

data frame with the ring widths.

Author(s)

Wilson Lara, Carlos Sierra, Felipe Bravo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## (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)')    

Example output

Loading required package: pastecs
Loading required package: boot
Loading required package: png
Loading required package: tiff
Loading required package: dplR
'data.frame':	62 obs. of  2 variables:
 $ year  : int  62 61 60 59 58 57 56 55 54 53 ...
 $ P105_a: num  0.991 0.838 0.686 0.94 0.787 ...
 - attr(*, "rbord.names")= chr  "P105_a" "borders"
 - attr(*, "rbord.row.names")= chr  "1" "2" "3" "4" ...
 - attr(*, "rbord.class")= chr "data.frame"
 - attr(*, "rbord.gray.dim")= int  20 1610
 - attr(*, "rbord.image")= chr "/usr/local/lib/R/site-library/measuRing/P105_a.tif"
 - attr(*, "rbord.ppi")= num 1000
 - attr(*, "rbord.rgb")= num  0.3 0.6 0.1
 - attr(*, "rbord.p.row")= num 1
 - attr(*, "rbord.origin")= num 0
 - attr(*, "rbord.auto.det")= logi TRUE
 - attr(*, "rbord.darker")= logi TRUE
 - attr(*, "rbord.inclu")= num  196 202 387 1564
 - attr(*, "rbord.exclu")= num  21 130 197 207 1444 ...
 - attr(*, "last.yr")= int 62

measuRing documentation built on May 2, 2019, 12:48 p.m.