| Title: | Multilevel Modeling of Dendroclimatical Fluctuations |
|---|---|
| Description: | Multilevel ecological data series (MEDS) are sequences of observations ordered according to temporal/spatial hierarchies that are defined by sample designs, with sample variability confined to ecological factors. Dendroclimatic MEDS of tree rings and climate are modeled into normalized fluctuations of tree growth and aridity. Modeled fluctuations (model frames) are compared with Mantel correlograms on multiple levels defined by sample design. Package implementation can be understood by running examples in modelFrame(), and muleMan() functions. |
| Authors: | Wilson Lara [aut, cre]
|
| Maintainer: | Wilson Lara <[email protected]> |
| License: | GPL-3 |
| Version: | 0.9.1 |
| Built: | 2026-06-01 10:40:52 UTC |
| Source: | https://github.com/cran/BIOdry |
Multilevel ecological data series (MEDS) are sequences of observations ordered according to temporal/spatial hierarchies that are defined by sample designs, with sample variability confined to ecological factors. Dendroclimatic MEDS of tree rings and climate are modeled into normalized fluctuations of tree growth and aridity. Modeled fluctuations (model frames) are compared with Mantel correlograms on multiple levels defined by sample design. Package implementation can be understood by running examples in modelFrame(), and muleMan() functions.
The DESCRIPTION file:
| Package: | BIOdry |
| Type: | Package |
| Title: | Multilevel Modeling of Dendroclimatical Fluctuations |
| Version: | 0.9.1 |
| Date: | 2025-04-03 |
| Authors@R: | c(person(given = "Wilson", family = "Lara", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-3527-1380")), person(given = "Felipe", family = "Bravo", role = "aut", email = "[email protected]", comment = c(ORCID = "0000-0001-7348-6695"))) |
| Maintainer: | Wilson Lara <[email protected]> |
| Description: | Multilevel ecological data series (MEDS) are sequences of observations ordered according to temporal/spatial hierarchies that are defined by sample designs, with sample variability confined to ecological factors. Dendroclimatic MEDS of tree rings and climate are modeled into normalized fluctuations of tree growth and aridity. Modeled fluctuations (model frames) are compared with Mantel correlograms on multiple levels defined by sample design. Package implementation can be understood by running examples in modelFrame(), and muleMan() functions. |
| License: | GPL-3 |
| Depends: | nlme, ecodist |
| LazyData: | TRUE |
| NeedsCompilation: | no |
| Packaged: | 2025-04-03 17:30:33 UTC; wihe |
| Author: | Wilson Lara [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo [aut] (<https://orcid.org/0000-0001-7348-6695>) |
| Config/pak/sysreqs: | libglpk-dev libxml2-dev |
| Repository: | https://wilarhen.r-universe.dev |
| Date/Publication: | 2025-04-03 18:42:10 UTC |
| RemoteUrl: | https://github.com/cran/BIOdry |
| RemoteRef: | HEAD |
| RemoteSha: | 198898f8a2c490f71625c0a2062cee54e8815b4c |
Index of help topics:
amod Allometric scaling.
anova.modelFrame Compare modelFrame objects
arguSelect Argument selection
BIOdry-package Multilevel Modeling of Dendroclimatical
Fluctuations
cClass Column-class extraction.
frametoLme LME modeling
levexp Vector releveling
lmeForm LME formula
modelFrame Dendroclimatic-fluctuations modeling
moveYr Seasonal years
muleMan Multilevel dendroclimatic correlograms
mUnits Metric system
Pchron Tree-ring width (TRW) chronology
plot.modelFrame Plot modelFrame objects
plot.muleMan Plot muleMan objects
plot.wlai Plot an wlai object
Pradii03 Vector of radii measured on P.pinaster
Prec Cumulative precipitations
Prings05 Multilevel data set of P. pinaster
PTclim05 Multilevel data set of monthly cumulative
precipitations and monthly average temperatures
ringApply Multilevel apply
rtimes Time-units synchronization
scacum Cummulative-scaled sums
shiftFrame MEDS formatting
slitFrame Multilevel splitting
summary.modelFrame summarize a modelFrame object
tdForm ltd formulas
Temp Average temperatures
wlai Walter-Lieth aridity index
Maintainer: Wilson Lara <[email protected]>
Wilson Lara <[email protected]>, Felipe Bravo <[email protected]>
Allometric models and parameters are used to scale organic growth.
amod(x, mp = c(1, 1), fun = y ~ a * (x^b))amod(x, mp = c(1, 1), fun = y ~ a * (x^b))
x |
|
mp |
|
fun |
|
. Allometric models are useful to
scale size-components of organisms such as
tree diameters (mp = c(2,1)) and
basal areas (mp = c(0.25 *
pi,2)). Several parameter groups
(c(a1,b1,a2,b2, ..., an,bn)) can be
recursively processed. This enables
computation of complex organic
variables. For example, above-ground tree
biomass could be computed from two
parameter groups for tree-biomass, and
over-bark diameter scaling.
data.frame of the scaled variable (x) and relative
increments (csx). These are computed with setdiff
function.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
## Simulating TRW records: set.seed(1) trw <- ts(abs(rnorm(12,1,1)),start = 1950) ## Cumulative TRW: cri <- cumsum(trw) ## tree diameters td <- amod(cri,mp = c(2,1)) ## plot of the tree diameters and the ## relative increments: plot(ts(td))## Simulating TRW records: set.seed(1) trw <- ts(abs(rnorm(12,1,1)),start = 1950) ## Cumulative TRW: cri <- cumsum(trw) ## tree diameters td <- amod(cri,mp = c(2,1)) ## plot of the tree diameters and the ## relative increments: plot(ts(td))
Models in modelFrame lists are compared with
anova.lme method.
## S3 method for class 'modelFrame' anova(object, ..., test, type, adjustSigma, Terms, L, verbose)## S3 method for class 'modelFrame' anova(object, ..., test, type, adjustSigma, Terms, L, verbose)
object |
an |
... |
other optional fitted model objects inheriting from
classes "modelFrame", "lme", "lm", among other (see
|
test |
optional character string specifying the |
type |
optional character string specifying the |
adjustSigma |
If TRUE and the estimation method used to obtain
|
Terms |
optional integer or character vector specifying which
terms in the model should be jointly tested to be zero
using a Wald F-test (see |
L |
optional numeric vector or array specifying linear
combinations of the coefficients in the model that should be
tested to be zero (see |
verbose |
optional logical value. If TRUE, the calling
sequences for each fitted model |
data frame inheriting from class "anova.lme".
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Lara W., F. Bravo, D. Maguire. 2013. Modeling patterns between drought and tree biomass growth from dendrochronological data: A multilevel approach. Agric. For. Meteorol., 178-179:140-151.
##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Fitting a single linear regression of the "tdForm" formula ## without random effects to the tree-biomass data: ## \donttest{ ## trwfl <- lm(log(x) ~ log(csx) + year, ## data = trwf$'model'$'data') ## } ## Comparing model likelihoods with anova method: ## \donttest{ ## anova(trwf, trwfl) ## }##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Fitting a single linear regression of the "tdForm" formula ## without random effects to the tree-biomass data: ## \donttest{ ## trwfl <- lm(log(x) ~ log(csx) + year, ## data = trwf$'model'$'data') ## } ## Comparing model likelihoods with anova method: ## \donttest{ ## anova(trwf, trwfl) ## }
Arguments of specific functions are selected from arbitrary numbers and varieties of arguments.
arguSelect(rd = NULL, fun = c("mapply", "ringApply"), ...)arguSelect(rd = NULL, fun = c("mapply", "ringApply"), ...)
rd |
|
fun |
|
... |
Further arguments not necessarily contained in the processed function(s). |
Closures with ellipsis terms use this
function to extract and pass arguments to
other functions. Arguments in MoreArgs
lists are also extracted and stored again as
MoreArgs lists.
list of selected arguments.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##Multilevel ecological data series of tree-ring widths: data(Prings05,envir = environment()) ## Radial increments measured on 2003: data(Pradii03,envir = environment()) ## Selection of arguments in some functions: ar1 <- arguSelect(fun = c('amod'), only.dup = TRUE, mp = c(0.5,1), rf.t = 2003) str(ar1) ar2 <- arguSelect(fn = 'amod', only.dup = TRUE, mp = c(0.5,1), rf.t = 2003) str(ar2) ar3 <- arguSelect(rd = Prings05, fn = 'amod', only.dup = TRUE, mp = c(0.5,1), rf.t = 2003) str(ar3) ar4 <- arguSelect(rd = Prings05, fun = 'scacum', sc.c = Pradii03, MoreArgs = list(only.dup = TRUE, mp = c(0.5,1), rf.t = 2003)) str(ar4) ar5 <- arguSelect(rd = Prings05, fun = 'scacum', ref = Pradii03, rf.t = rep(2003:2011), MoreArgs = list(only.dup = TRUE, mp = c(0.5,1))) str(ar5)##Multilevel ecological data series of tree-ring widths: data(Prings05,envir = environment()) ## Radial increments measured on 2003: data(Pradii03,envir = environment()) ## Selection of arguments in some functions: ar1 <- arguSelect(fun = c('amod'), only.dup = TRUE, mp = c(0.5,1), rf.t = 2003) str(ar1) ar2 <- arguSelect(fn = 'amod', only.dup = TRUE, mp = c(0.5,1), rf.t = 2003) str(ar2) ar3 <- arguSelect(rd = Prings05, fn = 'amod', only.dup = TRUE, mp = c(0.5,1), rf.t = 2003) str(ar3) ar4 <- arguSelect(rd = Prings05, fun = 'scacum', sc.c = Pradii03, MoreArgs = list(only.dup = TRUE, mp = c(0.5,1), rf.t = 2003)) str(ar4) ar5 <- arguSelect(rd = Prings05, fun = 'scacum', ref = Pradii03, rf.t = rep(2003:2011), MoreArgs = list(only.dup = TRUE, mp = c(0.5,1))) str(ar5)
Column names of multilevel data sets are extracted according to
three classes: numeric values, integer sequences,
and factor levels.
cClass(rd, cl = "all")cClass(rd, cl = "all")
rd |
|
cl |
|
character names.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##Multilevel data frame of tree-ring widths: data(Prings05,envir = environment()) ## Names of variables in Prings05 data containing numeric classes: cClass(Prings05, 'numeric') # 'x' ## Names of variables containing time units: cClass(Prings05, 'integer') # 'year' ## Names of variables containing factors: cClass(Prings05, 'factor') # 'sample', 'tree', 'plot'##Multilevel data frame of tree-ring widths: data(Prings05,envir = environment()) ## Names of variables in Prings05 data containing numeric classes: cClass(Prings05, 'numeric') # 'x' ## Names of variables containing time units: cClass(Prings05, 'integer') # 'year' ## Names of variables containing factors: cClass(Prings05, 'factor') # 'sample', 'tree', 'plot'
LME models are fitted to detrend multilevel ecological data series.
frametoLme(rd, form = "lmeForm", res.data = TRUE, ...)frametoLme(rd, form = "lmeForm", res.data = TRUE, ...)
rd |
|
form |
|
res.data |
|
... |
Further arguments to be passed to |
This function implements
lme function to fit linear
mixed-effects models on multilevel
ecological data series processed by the
modelFrame function. Two kind
of model formulas can be fitted: 'lmeForm'
and 'tdForm'; these characters implement
functions with same names
(tdForm and
lmeForm). Other lme formulas
can be specified by modifying arguments in
any of these two functions. After the lme
models are fitted, they can be extended by
implementing methods in nlme
package.
groupedData object.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Pinheiro J. C., D. M. Bates. 2000. Mixed-effects models in S and S-PLUS. Springer, New York.
##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Detrending the fluctuations by fitting a (l)td-form model ## with Maximum-likelihood method (ML): ## \donttest{ ## pdata <- trwf$'model'$'data' ## rlme <- frametoLme(pdata, ## form = 'tdForm', ## method = 'ML', ## log.t = TRUE) ## summary(rlme$model) ## } ##a plot of the modeled fluctuations: ## \donttest{ ## d <- nlme::groupedData(lmeForm(rlme$fluc,lev.rm = 1),data = rlme$fluc) ## plot(d,groups = ~ sample,auto.key = TRUE) ## } ## A model of aridity: ## \donttest{ ## cf <- modelFrame(PTclim05, ## lv = list('year','year'), ## fn = list('moveYr','wlai'), ## form = NULL) ## summary(cf) ## } ## An lme model of aridity at 'plot' level: ## \donttest{ ## cdata <- cf$'model'$'data' ## rmod <- frametoLme(cdata,form = 'lmeForm') ## summary(rmod$model) ## rk <- nlme::groupedData(lmeForm(rmod$fluc),data=rmod$fluc) ## plot(rk,ylab = 'detrended AI') ## }##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Detrending the fluctuations by fitting a (l)td-form model ## with Maximum-likelihood method (ML): ## \donttest{ ## pdata <- trwf$'model'$'data' ## rlme <- frametoLme(pdata, ## form = 'tdForm', ## method = 'ML', ## log.t = TRUE) ## summary(rlme$model) ## } ##a plot of the modeled fluctuations: ## \donttest{ ## d <- nlme::groupedData(lmeForm(rlme$fluc,lev.rm = 1),data = rlme$fluc) ## plot(d,groups = ~ sample,auto.key = TRUE) ## } ## A model of aridity: ## \donttest{ ## cf <- modelFrame(PTclim05, ## lv = list('year','year'), ## fn = list('moveYr','wlai'), ## form = NULL) ## summary(cf) ## } ## An lme model of aridity at 'plot' level: ## \donttest{ ## cdata <- cf$'model'$'data' ## rmod <- frametoLme(cdata,form = 'lmeForm') ## summary(rmod$model) ## rk <- nlme::groupedData(lmeForm(rmod$fluc),data=rmod$fluc) ## plot(rk,ylab = 'detrended AI') ## }
Expansion or reduction of a numeric vector by matching its level names with the ecological factors of a multilevel ecological data series.
levexp(x, levels)levexp(x, levels)
x |
|
levels |
|
numeric vector with expanded/reduced levels.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##Multilevel ecological data series of tree-ring widths: data(Prings05,envir = environment()) ## tree radii measured at 2003: data(Pradii03,envir = environment()) ## Releveling the tree radii refs <- levexp(Pradii03,Prings05) refs##Multilevel ecological data series of tree-ring widths: data(Prings05,envir = environment()) ## tree radii measured at 2003: data(Pradii03,envir = environment()) ## Releveling the tree radii refs <- levexp(Pradii03,Prings05) refs
This function computes LME formulas from multilevel ecological data series (MEDS).
lmeForm(rd, prim.cov = FALSE, resp = NULL, covar = NULL, lev.rm = NULL)lmeForm(rd, prim.cov = FALSE, resp = NULL, covar = NULL, lev.rm = NULL)
rd |
|
prim.cov |
|
resp |
|
covar |
|
lev.rm |
|
Formulas of the form resp ~ cov
| group (see groupedData
function) are computed from MEDS. The formulas
can be implemented by
modelFrame function to detrend MEDS
formula with any of the forms: resp ~ cov | group or
~ cov.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Pinheiro J. C., D. M. Bates. 2000. Mixed-effects models in S and S-PLUS. Springer, New York.
##Multilevel ecological data series of tree-ring widths: data(Prings05,envir = environment()) ## LME formula: form1 <- lmeForm(Prings05,prim.cov = FALSE) print(form1) ## removing the sample level from the formula form2 <- lmeForm(Prings05,lev.rm = 'sample') form2 <- lmeForm(Prings05,lev.rm = 1) ## groupedData object with the LME formula gdata <- groupedData(lmeForm(Prings05,lev.rm = 1), data = Prings05) plot(gdata,groups = ~ sample)##Multilevel ecological data series of tree-ring widths: data(Prings05,envir = environment()) ## LME formula: form1 <- lmeForm(Prings05,prim.cov = FALSE) print(form1) ## removing the sample level from the formula form2 <- lmeForm(Prings05,lev.rm = 'sample') form2 <- lmeForm(Prings05,lev.rm = 1) ## groupedData object with the LME formula gdata <- groupedData(lmeForm(Prings05,lev.rm = 1), data = Prings05) plot(gdata,groups = ~ sample)
This function develops recursive evaluation of functions for one-level modeling (FOLM) and LME detrending of dendroclimatic chronologies.
modelFrame(rd, fn = list("rtimes", "scacum", "amod"), lv = list(2, 1, 1), form = "tdForm", ...)modelFrame(rd, fn = list("rtimes", "scacum", "amod"), lv = list(2, 1, 1), form = "tdForm", ...)
rd |
|
fn |
|
lv |
|
form |
|
... |
Further arguments in |
Defaults model fluctuations in
tree-ring width chronologies via recursive
implementation of four FOLM:
rtimes, scacum,
amod, and
frametoLme. Nevertheless,
other FOLM can be implemented to model
aridity-index fluctuations(see example with
climatic data). Processed chronologies are
detrended with lme function
and other nlme methods
. Internal algorithm uses
shiftFrame
arguSelect and
ringApply
functions. Consequently, arguments that are
not iterated over factor-level labels in the
processed data are specified in 'MoreArgs'
lists (see examples). Arguments in
modelFrame objects can be updated
with update function.
Threefold list with fluctuations in fluc,
groupedData object in model, and model call in
call.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Lara W., F. Bravo, D. Maguire. 2013. Modeling patterns between drought and tree biomass growth from dendrochronological data: A multilevel approach. Agric. For. Meteorol., 178-179:140-151.
##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Climatic records: data(Temp,envir = environment()) data(Prec,envir = environment()) ## Aridity-index fluctuations: ## \donttest{ ## aif <- modelFrame(rd = list(Prec, Temp), ## fn = list('moveYr','wlai'), ## lv = list('year','year'), ## form = 'lmeForm') ## summary(aif$'model') ## }##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Climatic records: data(Temp,envir = environment()) data(Prec,envir = environment()) ## Aridity-index fluctuations: ## \donttest{ ## aif <- modelFrame(rd = list(Prec, Temp), ## fn = list('moveYr','wlai'), ## lv = list('year','year'), ## form = 'lmeForm') ## summary(aif$'model') ## }
Monthly records in time-series replicates (usually of climate) are labeled for the years can begin in a month other than January.
moveYr(cd, ini.mnt = "Oct")moveYr(cd, ini.mnt = "Oct")
cd |
|
ini.mnt |
|
character months as defined in
month.abb or month.name.
data.frame object with the months being numeric
values and the years beginning at ini.mnt argument.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
## Climatic records of monthly precipitation sums and monthly ## average temperatures data(PTclim05,envir = environment()) ## Making the year 1955 in plot 'P16106' to begin on 'April' cl1 <- slitFrame(PTclim05,c('year','plot'))[[1]] cl2 <- moveYr(cl1,ini.mnt = 'Mar') head(cl2) ## a simple vector of years yr <- rep(2005,12) names(yr) <- month.abb[1:12] moveYr(yr)## Climatic records of monthly precipitation sums and monthly ## average temperatures data(PTclim05,envir = environment()) ## Making the year 1955 in plot 'P16106' to begin on 'April' cl1 <- slitFrame(PTclim05,c('year','plot'))[[1]] cl2 <- moveYr(cl1,ini.mnt = 'Mar') head(cl2) ## a simple vector of years yr <- rep(2005,12) names(yr) <- month.abb[1:12] moveYr(yr)
Multivariate correlograms between TRW fluctuations and climatic fluctuations.
muleMan(rd, cd, rd.var = NULL, cd.var = NULL, ...)muleMan(rd, cd, rd.var = NULL, cd.var = NULL, ...)
rd |
|
cd |
|
rd.var |
|
cd.var |
|
... |
Further arguments in |
Function mgram
is implemented to compare the dendroclimatic
fluctuations. Models being compared should have
common higher-level factors (see example).
data.frame object of multivariate correlations.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Lara W., F. Bravo, D. Maguire. 2013. Modeling patterns between drought and tree biomass growth from dendrochronological data: A multilevel approach. Agric. For. Meteorol., 178-179:140-151.
##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## /donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Climatic Records: data(Temp,envir = environment()) data(Prec,envir = environment()) ## Aridity-index fluctuations: ## /donttest{ ## aif <- modelFrame(rd = list(Prec, Temp), ## fn = list('moveYr','wlai'), ## lv = list('year','year'), ## form = 'lmeForm') ## } ##Multivariate comparison: ## /donttest{ ## mcomp <- muleMan(trwf, ## aif, ## nperm = 10^3) ## str(mcomp) ## }##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## /donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Climatic Records: data(Temp,envir = environment()) data(Prec,envir = environment()) ## Aridity-index fluctuations: ## /donttest{ ## aif <- modelFrame(rd = list(Prec, Temp), ## fn = list('moveYr','wlai'), ## lv = list('year','year'), ## form = 'lmeForm') ## } ##Multivariate comparison: ## /donttest{ ## mcomp <- muleMan(trwf, ## aif, ## nperm = 10^3) ## str(mcomp) ## }
This function control metric units.
mUnits(x, from = "mm", to = "mm")mUnits(x, from = "mm", to = "mm")
x |
|
from |
|
to |
|
Characters in from and to
arguments have the form 'p_', where 'p' is the
metric prefix and '_' is a base unit. Sixteen
metric prefixes are supported: atto 'a', femto
'f', pico 'p', nano 'n', micro 'mm', mili 'm',
centi 'c', deci 'd', deca 'da', hecto 'h', kilo
'k', mega 'M', giga 'G', tera 'T', peta 'P', and
exa 'E'.
numeric vector.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
## Simulation of TRW data set.seed(1) w <- abs(rnorm(12,1,1)) trw <- ts(w,start = 1970) ## transforming metric units of trw vector from milimeters to meters sr <- mUnits(trw, from = 'mm', to = 'm') attributes(sr)## Simulation of TRW data set.seed(1) w <- abs(rnorm(12,1,1)) trw <- ts(w,start = 1970) ## transforming metric units of trw vector from milimeters to meters sr <- mUnits(trw, from = 'mm', to = 'm') attributes(sr)
TRW chronology for Pinus pinaster forests from two sample plots in northern Spain (Soria) and east-central Spain (Cuenca). The data set contains eight TRW series. To account for source variability, two trees were selected per site, and two samples were extracted from each tree.
data(Pchron)data(Pchron)
data.frame object with eight columns.
Row names of the data set are time-units labels (years of formation).
Column names represent levels in three within-stand ecological factors that are common to most TRW data and represent variability in stand qualities (stand), tree-radial morphology (sample), and tree genetics/phenotypes (tree). The names are dot-separated labels representing the hierarchy of the three ecological factors, where higher ecological-factor levels are defined first and lower levels after. For example, code 'P16106.17.a' is the column name of sample replicate 'a' in tree '17' in plot 'P16106'.
This data set belongs to a more extensive tree-ring chronology which was processed in previous studies (Bogino and Bravo, 2008) by measuring TRW in polished-core samples (5 mm diameter) using the Windendro program and cross-dating the tree-ring chronologies using COFECHA software. Time units for the TRWs are formation years spanning from 1861 to 2005. The cross-dating records suggested that maritime pine chronologies had high SNR: (23-28 in northern Spain, and 38-61 in east-central Spain) and high EPS (0.96 in northern Spain, and 0.98 in east-central Spain).
Bogino, S., and Bravo, F. (2008). Growth response of Pinus pinaster Ait. to climatic variables in central Spanish forests. Ann. For. Sci. 65, 1-13.
str(Pchron)str(Pchron)
Diagnostic Trellis plot for fluctuations in
modelFrame objects are obtained.
## S3 method for class 'modelFrame' plot(x, ...)## S3 method for class 'modelFrame' plot(x, ...)
x |
An object inheriting from class |
... |
further arguments passed to the Trellis plot function. |
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## /donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## plot(trwf, grid = FALSE) ## }##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function) ## /donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## plot(trwf, grid = FALSE) ## }
Diagnostic Trellis plot for fluctuations in
muleMan objects are obtained.
## S3 method for class 'muleMan' plot(x, ...)## S3 method for class 'muleMan' plot(x, ...)
x |
An object inheriting from class |
... |
further arguments passed to the Trellis plot function. |
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function): ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Climatic Records: data(Temp,envir = environment()) data(Prec,envir = environment()) ## Aridity-index fluctuations: ## \donttest{ ## aif <- modelFrame(rd = list(Prec, Temp), ## fn = list('moveYr','wlai'), ## lv = list('year','year'), ## form = 'lmeForm') ## } ##Multivariate comparison: ## \donttest{ ## mcomp <- muleMan(trwf, ## aif, ## nperm = 10^3) ## plot(mcomp, grid = FALSE) ## }##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function): ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = FALSE, ## on.time = FALSE) ## } ## Climatic Records: data(Temp,envir = environment()) data(Prec,envir = environment()) ## Aridity-index fluctuations: ## \donttest{ ## aif <- modelFrame(rd = list(Prec, Temp), ## fn = list('moveYr','wlai'), ## lv = list('year','year'), ## form = 'lmeForm') ## } ##Multivariate comparison: ## \donttest{ ## mcomp <- muleMan(trwf, ## aif, ## nperm = 10^3) ## plot(mcomp, grid = FALSE) ## }
A Walter-Lieth climate diagram is produced.
## S3 method for class 'wlai' plot(x, ...)## S3 method for class 'wlai' plot(x, ...)
x |
|
... |
|
Areas between temperature and precipitation lines when precipitation exceeds temperature (moist seasons) are plotted in gray color, and areas where temperature exceeds precipitation (dry seasons) are plotted in black color. Monthly cumulative precipitations over 100 mm are scaled such that 1 degree C of average temperature is equal to 5 mm of precipitation.
A plot of the Walter-Lieth diagram.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Manrique E., A. Fernandez-Cancio. 2000. Extreme climatic events in dendroclimatic reconstructions from Spain. Clim. Chang., 44: 123-138.
##random simulation of climatic records set.seed(1) pr <- rnorm(12,1,1) tm <- rnorm(12,0,1) cld <- data.frame(pr,tm) ##labels of months from october to september rownames(cld) <- month.abb[c(10:12,1:9)] rownames(cld) <- c(10:12,1:9) ##computation of the aridity index and climate diagram AI <- wlai(cld) plot.wlai(AI)##random simulation of climatic records set.seed(1) pr <- rnorm(12,1,1) tm <- rnorm(12,0,1) cld <- data.frame(pr,tm) ##labels of months from october to september rownames(cld) <- month.abb[c(10:12,1:9)] rownames(cld) <- c(10:12,1:9) ##computation of the aridity index and climate diagram AI <- wlai(cld) plot.wlai(AI)
Vector of radii measured in dominant trees of P.pinaster (2003) growing on the Ebro river basin, Spain
data(Pradii03)data(Pradii03)
A numeric vector with names of the vector indicating the measured tree.
This vector contains inside-bark radii, measured in four trees during 2003 (mm). This radial vector was derived from the over-bark diameters at breast height (cm), with allometric estimation of inside-bark diameters from the over-bark diameters. Names of the vector correspond to labels at tree level
Sustainable Forest Management Research Institute, Universidad de Valladolid (UVa)-INIA.
str(Pradii03)str(Pradii03)
Monthly cumulative precipitation (mm).
data(Prec)data(Prec)
data.frame object with 24 records.
Column names contain plot codes and monthly abbreviations
Recorded months begin at January and end at December, and observed years span from 1951 to 2005. Factor in data set defines one sample level (plot)
Bogino, S., and Bravo, F. (2008). Growth response of Pinus pinaster Ait. to climatic variables in central Spanish forests. Ann. For. Sci. 65, 1-13.
str(Prec)str(Prec)
Radial increments of Pinus pinaster from two sample plots located on Northern and Southern portions of Ebro river basin, Spain.
data(Prings05)data(Prings05)
A data frame with the following 5 variables.
xA numeric vector with the radial increments in mm year-1
yearA numeric vector with the recorded year
sampleA factor indicating the sample replicate
treeA factor indicating the tree number
plotA factor indicating the plot code
This data set contains eight series of tree-ring widths of maritime pine (Pinus pinaster), with recorded years spanning from 1810 to 2005. The cores were sampled from dominant trees of two sites, with sample plots being located on both: northern Spain (plot code: P44005) and center-east portion of the same country (plot code: P16106). Two trees were selected by plot, and two core samples were extracted by tree. Consequently, the sample design defined three levels: sample in tree on plot (plot level), sample in tree (tree level), and sample level.
Bogino, S., and Bravo, F. (2008). Growth response of Pinus pinaster Ait. to climatic variables in central Spanish forests. Ann. For. Sci. 65, 1-13.
str(Prings05)str(Prings05)
Monthly precipitation sums and average temperatures of two climatic locations.
data(PTclim05)data(PTclim05)
A data frame with the following 5 variables.
prA numeric vector with the monthly cumulative precipitations (mm month-1)
tmA numeric vector with the monthly average temperatures (degree C month-1)
monthA numeric vector of months
yearA numeric vector of years
plotA factor vector of plot codes
Recorded months begin at January and end at December, and observed years span from 1951 to 2005. Factor in data set defines one sample level (plot)
Bogino, S., and Bravo, F. (2008). Growth response of Pinus pinaster Ait. to climatic variables in central Spanish forests. Ann. For. Sci. 65, 1-13.
str(PTclim05)str(PTclim05)
Wrapper of Map to apply functions on multilevel data
series and preserve factor-level structure in the outputs.
ringApply(rd, lv = 1, fn = "scacum", ...)ringApply(rd, lv = 1, fn = "scacum", ...)
rd |
|
lv |
|
fn |
|
... |
Further arguments in the function being specified
|
Other functions such as
rtimes, scacum,
amod, or wlai can
be implemented. Function arguments should be
formulated as suggested in
mapply, with constant
arguments being stored in a MoreArgs
list. This function is implemented by
modelFrame for recursive
modeling of MEDS.
data.frame object preserving initial factor-level columns.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Lara, W., F. Bravo, D. Maguire. 2013. Modeling patterns between drought and tree biomass growth from dendrochronological data: A multilevel approach. Agric. For. Meteorol., 178-179:140-151.
##Multilevel ecological data series (MEDS) of tree-ring widths: data(Prings05,envir = environment()) ## Radial increments measured on 2003: data(Pradii03,envir = environment()) ## MEDS of monthly precipitation sums and average temperatures: data(PTclim05,envir = environment()) ##Tree-level scaling of years of formation ##with 'rtimes' function: dfm1 <- ringApply(Prings05, lv = 2, fn = 'rtimes') str(dfm1) ##Relative time-units from year 1 to year 9: subset(dfm1,time%in%c(1:9,NA)) ## Sample-level scaling of TRW chronologies around reference radii ## which were measured at 2003: dfm2 <- ringApply(dfm1, lv = 'sample', sc.c = Pradii03, rf.t = 2003, fn = 'scacum') str(dfm2) ##Sample-level modeling of basal areas (mm2) via allometric ##scaling: dfm3 <- ringApply(dfm2, lv = 'sample', fn = 'amod', MoreArgs = list(mp = c(2,1,0.25 * pi,2))) str(dfm3) ## Seasonal years from 'October' to 'September': cl1 <- ringApply(PTclim05, lv = 'year', fn = 'moveYr') tail(cl1,15) ##Year-level aridity indexes: wl <- ringApply(cl1, lv = 'year', fn = 'wlai') str(wl) ## Plot of aridity-index fluctuations: d <- groupedData(lmeForm(wl),wl) plot(d)##Multilevel ecological data series (MEDS) of tree-ring widths: data(Prings05,envir = environment()) ## Radial increments measured on 2003: data(Pradii03,envir = environment()) ## MEDS of monthly precipitation sums and average temperatures: data(PTclim05,envir = environment()) ##Tree-level scaling of years of formation ##with 'rtimes' function: dfm1 <- ringApply(Prings05, lv = 2, fn = 'rtimes') str(dfm1) ##Relative time-units from year 1 to year 9: subset(dfm1,time%in%c(1:9,NA)) ## Sample-level scaling of TRW chronologies around reference radii ## which were measured at 2003: dfm2 <- ringApply(dfm1, lv = 'sample', sc.c = Pradii03, rf.t = 2003, fn = 'scacum') str(dfm2) ##Sample-level modeling of basal areas (mm2) via allometric ##scaling: dfm3 <- ringApply(dfm2, lv = 'sample', fn = 'amod', MoreArgs = list(mp = c(2,1,0.25 * pi,2))) str(dfm3) ## Seasonal years from 'October' to 'September': cl1 <- ringApply(PTclim05, lv = 'year', fn = 'moveYr') tail(cl1,15) ##Year-level aridity indexes: wl <- ringApply(cl1, lv = 'year', fn = 'wlai') str(wl) ## Plot of aridity-index fluctuations: d <- groupedData(lmeForm(wl),wl) plot(d)
Unique observations in time-series replicates are excluded
rtimes(x, only.dup = TRUE)rtimes(x, only.dup = TRUE)
x |
multilevel ecological data series containing a column of
time units, or |
only.dup |
|
data.frame object with the initial vector and its time
units.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
## row names of a vector fy <- function(y,span){(y - span):y} x <- c(fy(2005,5),fy(2007,10)) ## (not run) Simulating the vector r <- abs(rnorm(length(x))) names(r) <- x ## (not run) computing the synchronized times: rtimes(r,only.dup = TRUE) ## (not run) Extracting only duplicated times: na.omit(rtimes(r,only.dup = TRUE))## row names of a vector fy <- function(y,span){(y - span):y} x <- c(fy(2005,5),fy(2007,10)) ## (not run) Simulating the vector r <- abs(rnorm(length(x))) names(r) <- x ## (not run) computing the synchronized times: rtimes(r,only.dup = TRUE) ## (not run) Extracting only duplicated times: na.omit(rtimes(r,only.dup = TRUE))
This function computes cummulative and scaled sums of time-series replicates.
scacum(x, sc.c = NA, rf.t = NA)scacum(x, sc.c = NA, rf.t = NA)
x |
|
sc.c |
|
rf.t |
|
Cummulative sums of time-series replicates (e.g. tree-ring widths) are scaled around reference values (e.g. tree radii).
data frame with the original vector, and its scaled-cummulative sums.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
x <- c(0.79,0.32,0.53,0.43,0.18) names(x) <- 1948:1952 scacum(x,sc.c = 4,rf.t = 1951) ##If sc.c = NA then cummulative values are scaled arround ##max(cumsum(x)): max(cumsum(x)) scacum(x,NA,1951)x <- c(0.79,0.32,0.53,0.43,0.18) names(x) <- 1948:1952 scacum(x,sc.c = 4,rf.t = 1951) ##If sc.c = NA then cummulative values are scaled arround ##max(cumsum(x)): max(cumsum(x)) scacum(x,NA,1951)
dendroclimatic chronologies (trw, and climatic data) are formatted into multilevel ecological data series. SI units of continuous variables in the data can be transformed.
shiftFrame(rd, f.nm = NULL, x.nm = names(rd)[1L], t.nm = "year", ...)shiftFrame(rd, f.nm = NULL, x.nm = names(rd)[1L], t.nm = "year", ...)
rd |
|
f.nm |
|
x.nm |
|
t.nm |
|
... |
Further arguments in |
Row names of dendroclimatic data frames are time units (e.g. years). Column names are dot-separated labels representing the hierarchy of ecological or time-units factors, where the higher levels are defined first and the lower levels after. For example, code 'P16106.17' is the column name of core 'a' in tree '17' in plot 'P16106'. Labels containing monthly abbreviations are also formatted.
When rd argument is a dendroclimatic chronology (see
details) then the output is a groupedData object,
and viceversa.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##tree-ring widths formated as a \code{\link[nlme]{groupedData}} object: data(Prings05,envir = environment()) ## Formatting the \code{\link[nlme]{groupedData}} object into a ring-data frame: pwide <- shiftFrame(Prings05, from = 'mm', to = 'mmm') str(pwide) ## Formatting the ring-data frame into a groupedData object, and ## changing SI units from micrometers to milimeters: plong <- shiftFrame(pwide,from = 'mmm', to = 'mm') plot(plong)##tree-ring widths formated as a \code{\link[nlme]{groupedData}} object: data(Prings05,envir = environment()) ## Formatting the \code{\link[nlme]{groupedData}} object into a ring-data frame: pwide <- shiftFrame(Prings05, from = 'mm', to = 'mmm') str(pwide) ## Formatting the ring-data frame into a groupedData object, and ## changing SI units from micrometers to milimeters: plong <- shiftFrame(pwide,from = 'mmm', to = 'mm') plot(plong)
This function splits a Multilevel data frame into factor levels.
slitFrame(rd, lv = cClass(rd, "factor"))slitFrame(rd, lv = cClass(rd, "factor"))
rd |
|
lv |
|
list of data.frame objects.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##Ring data frame: ##Multilevel data frame of tree-ring widths: data(Prings05, envir = environment()) data(PTclim05, envir = environment()) ## split multilevel data into its second factor-level column: spl <- slitFrame(Prings05) str(spl) ## split the data into the factor-level: 'year': spl <- slitFrame(Prings05,'year') str(spl) spl <- slitFrame(PTclim05,'year') str(spl)##Ring data frame: ##Multilevel data frame of tree-ring widths: data(Prings05, envir = environment()) data(PTclim05, envir = environment()) ## split multilevel data into its second factor-level column: spl <- slitFrame(Prings05) str(spl) ## split the data into the factor-level: 'year': spl <- slitFrame(Prings05,'year') str(spl) spl <- slitFrame(PTclim05,'year') str(spl)
A summary of a modelFrame object is obtained.
## S3 method for class 'modelFrame' summary(object, ...)## S3 method for class 'modelFrame' summary(object, ...)
object |
an |
... |
additional optional arguments passed to
|
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function): ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = TRUE, ## on.time = TRUE) ## summary(trwf) ## }##TRW chronology (mm) and inside-bark radii data(Pchron,envir = environment()) ## Parameters of allometric model to compute Diameter at Breast ## Height over bark (DBH, cm) from diameter inside bark (dib, cm) ## and Total Tree Biomass (TTB, kg tree -1 ) from DBH (Lara ## et. al. 2013): biom_param <- c(2.87, 0.85, 0.05, 2.5) ## Modeling tree-biomass fluctuations while accounting for ## within-plot source variability (see defaults in "modelFrame" ## function): ## \donttest{ ## trwf <- modelFrame(Pchron, ## to = 'cm', ## MoreArgs = list(mp = c(2,1, biom_param)), ## log.t = TRUE, ## on.time = TRUE) ## summary(trwf) ## }
This function formulates linear time-decline formulas (ltd) from categorical variables in multilevel ecological data series.
tdForm(rd, prim.cov = FALSE, on.time = TRUE, log.t = FALSE, lev.rm = NULL)tdForm(rd, prim.cov = FALSE, on.time = TRUE, log.t = FALSE, lev.rm = NULL)
rd |
|
prim.cov |
|
on.time |
|
log.t |
|
lev.rm |
NULL or |
the ltd formulas belong to following
general equation: log (x) = log (csx) + f(time);
where the relative organic growth (x) is
explained by the cumulative organic growth (csx)
plus a function of time f(time); with f(time)
being either the time or a logarithmic
transformation the time. The ltd can be
implemented by modelFrame function
to subtract trends in organic MEDS
formula with the forms: 'resp ~ cov | group' or '~ cov'.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Zeide B. 1993. Analysis of Growth Equations. For. Sci., 39: 594-616.
## an ltd formula: lev <- c('plot','tree') tdeq <- tdForm(lev,log.t = TRUE) tdeq ## (not run) only primary covariate: tdeq1 <- tdForm(lev,prim.cov = TRUE) tdeq1 ##Multilevel data frame of tree-ring widths: data(Prings05,envir = environment()) ## removing two levels: 'plot' and 'tree' from the formula tdea2 <- tdForm(Prings05, lev.rm = c('plot','tree')) tdea2 <- tdForm(Prings05, lev.rm = 2:3)## an ltd formula: lev <- c('plot','tree') tdeq <- tdForm(lev,log.t = TRUE) tdeq ## (not run) only primary covariate: tdeq1 <- tdForm(lev,prim.cov = TRUE) tdeq1 ##Multilevel data frame of tree-ring widths: data(Prings05,envir = environment()) ## removing two levels: 'plot' and 'tree' from the formula tdea2 <- tdForm(Prings05, lev.rm = c('plot','tree')) tdea2 <- tdForm(Prings05, lev.rm = 2:3)
Monthly average temperatures (degree C).
data(Temp)data(Temp)
data.frame object with 24 records.
Column names contain plot codes and monthly abbreviations
Recorded months begin at January and end at December, and observed years span from 1951 to 2005. Factor in data set defines one sample level (plot)
Bogino, S., and Bravo, F. (2008). Growth response of Pinus pinaster Ait. to climatic variables in central Spanish forests. Ann. For. Sci. 65, 1-13.
str(Temp)str(Temp)
Computing the annual aridity index from Walter-Lieth climate diagrams
wlai(cd, sqt = TRUE)wlai(cd, sqt = TRUE)
cd |
|
sqt |
|
Areas between temperature and precipitation lines when precipitation exceeds temperature are calculated as indicators of moist seasons, and areas where temperature exceeds precipitation are calculated as indicator of dry season. The aridity index is defined as the quotient between the areas of dry and wet seasons. Precipitations over 100 mm are scaled such that 1 degree C is equal to 5 mm.
numeric aridity index and plot of the Walter-Lieth diagram.
Wilson Lara <[email protected]> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Felipe Bravo <[email protected]> [aut] (<https://orcid.org/0000-0001-7348-6695>)
Manrique E., A. Fernandez-Cancio. 2000. Extreme climatic events in dendroclimatic reconstructions from Spain. Clim. Chang., 44: 123-138.
##random simulation of climatic records set.seed(1) pr <- rnorm(12,1,1) tm <- rnorm(12,0,1) cld <- data.frame(pr,tm) ##labels of months from october to september rownames(cld) <- month.abb[c(10:12,1:9)] rownames(cld) <- c(10:12,1:9) ##computation of the aridity index and climate diagram AI <- wlai(cld) AI##random simulation of climatic records set.seed(1) pr <- rnorm(12,1,1) tm <- rnorm(12,0,1) cld <- data.frame(pr,tm) ##labels of months from october to september rownames(cld) <- month.abb[c(10:12,1:9)] rownames(cld) <- c(10:12,1:9) ##computation of the aridity index and climate diagram AI <- wlai(cld) AI