Learn R Programming

BIOdry (version 0.4)

muleMan: Multilevel correlograms

Description

Mantel correlograms between two multilevel ecological data series (MEDS).

Usage

muleMan(rd, cd, rd.var = NULL, cd.var = NULL, ...)

Arguments

rd
list or dataframe. First multilevel ecological data series, or modelFrame object, to be compared.
cd
list or dataframe. Second MEDS, or modelFrame object, to be compared.
rd.var
character or NULL. Column name of first MEDS in rd argument. If NULL then the first column is processed.
cd.var
character or NULL. Column name of second MEDS in cd argument. If NULL then the first column is used.
...
Further arguments in mgram

Value

groupedData object) with the Mantel correlations.

Details

Function mgram in package ecodist is implemented to compare two modelFrame objects, with the first object containing modeled fluctuations of tree growth, and the second one being the modeled fluctuations of aridity. Correspondent aridity model should have at least one level in common with the modeled tree growth (see example).

References

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.

Examples

Run this code
## Fluctuations of tree growh and aridity are modeled and
## compared.

##Multilevel ecological data series of tree-ring widths:
data(Prings05,envir = environment())
## Radial increments measured on 2003:
data(Pradii03,envir = environment())    
## Monthly precipitations and temperatures:
data(PTclim05,envir = environment())

## Modeling fluctuations of aridity 
cf <- modelFrame(rd=PTclim05,
                 lv = list('year','year'),
                 fn = list('moveYr','wlai'),
                 form = 'lmeForm')
head(cf$resid)
summary(cf$model)

## Modeling fluctuations of tree growth
ar <- modelFrame(Prings05, y = Pradii03,
                 form = 'tdForm', on.time = TRUE,
                 MoreArgs = list(only.dup = TRUE,
                                 mp = c(1,1),un = c('mm','cm'),z = 2003))
head(ar$resid)
summary(ar$model)

## Multilevel correlogram:
mancor <- muleMan(ar,cf,nperm = 10^3)
head(mancor)

## Vector of significances (p < 0.05): 
sig <- with(mancor,ifelse(pval < 0.05,TRUE,FALSE))
## Plotting the multilevel correlograms with correspondent
## significances:
plot(mancor,
     groups = sig,
     pch = c(21,19),
     grid = FALSE,
     abline = list(h = 0, lty = 2, lwd = 0.5),
     layout = c(4,2))

Run the code above in your browser using DataLab