##Multilevel data frame of tree-ring widths:
data(Prings05,envir = environment())
## Radial increments measured on 2003:
data(Pradii03,envir = environment())
## Monthly precipitation sums and average temperatures:
data(PTclim05,envir = environment())
##synchronized times by tree with 'rtimes':
dfm1 <- ringApply(Prings05,lv = 2,fn = 'rtimes')
str(dfm1)
##some synchronized times from time 1 to time 9:
subset(dfm1,time%in%c(1:9,NA))
## Cummulative radial increments by sample:
dfm2 <- ringApply(dfm1,lv = 'sample',y = Pradii03,fn = 'scacum')
str(dfm2)
##Allometric modeling by sample:
dfm3 <- ringApply(dfm2,lv = 'sample',fn = 'amod',
MoreArgs = list(mp = c(1,1,0.25 * pi,2),
un = c('mm','m')))
str(dfm3)
## seasonal years from 'October' to 'September':
cl1 <- ringApply(PTclim05,lv = 'year',fn = 'moveYr')
##using ringApply to compute multilevel aridity indexes with
##function 'wlai':
tail(cl1,15)
wl <- ringApply(cl1,lv = 'year',fn = 'wlai')
str(wl)#only yearly levels with 12 months are evaluated
## A plot of the computed fluctuations of aridity
d <- groupedData(lmeForm(wl),wl)
plot(d)
Run the code above in your browser using DataLab