oveRR: an object produced by applying overfitRR on the object provided to the function as RR.
x1, node, cov: arguments as passed to overfitRR.
x1.residuals: as passed to search.trend. Default is FALSE.
clus: the proportion of clusters to be used in parallel computing. To run the single-threaded version of overfitST set clus = 0.
Returns
The function returns a 'RRphyloList' object containing:
$ST.list a 'RRphyloList' including the results of each search.trend performed within overfitST.
trend.resultsalistincludingthepercentageofsimulationsshowingsignificantp−valuesforphenotypesversusageandabsoluteratesversusageregressionsfortheentiretreeseparatedbyslopesign(tree). If one or more nodes are specified within trend.args, the list also includes the same results at nodes (node)andtheresultsforcomparisonbetweennodes(comparison). For each node the proportion of tested trees (i.e. where the clade identity was preserved; always 1 if no phylo.list is supplied) is also indicated.
The output always has an attribute "Call" which returns an unevaluated call to the function.
Examples
## Not run:cc<-2/parallel::detectCores()library(ape)## Case 1# load the RRphylo example dataset including Ornithodirans tree and datadata("DataOrnithodirans")DataOrnithodirans$treedino->treedino
DataOrnithodirans$massdino->massdino
DataOrnithodirans$statedino->statedino
# extract Pterosaurs tree and dataextract.clade(treedino,746)->treeptero
massdino[match(treeptero$tip.label,names(massdino))]->massptero
massptero[match(treeptero$tip.label,names(massptero))]->massptero
# perform RRphylo and search.trend on body mass dataRRphylo(tree=treeptero,y=log(massptero),clus=cc)->RRptero
search.trend(RR=RRptero, y=log(massptero),node=143,clus=cc)->st2
## overfitST routine# generate a list of subsampled and swapped phylogenies setting as node# the clade under testingtreeptero.list<-resampleTree(RRptero$tree,s =0.25,node=143, swap.si =0.1,swap.si2 =0.1,nsim=10)# test the robustness of search.trendofRRptero<-overfitRR(RR = RRptero,y=log(massptero),phylo.list=treeptero.list,clus=cc)ofSTptero<-overfitST(RR=RRptero,y=log(massptero),oveRR=ofRRptero,node=143,clus=cc)## Case 2# load the RRphylo example dataset including Cetaceans tree and datadata("DataCetaceans")DataCetaceans$treecet->treecet
DataCetaceans$masscet->masscet
DataCetaceans$brainmasscet->brainmasscet
# cross-reference the phylogenetic tree and body and brain mass data. Remove from# both the tree and vector of body sizes the species whose brain size is missingdrop.tip(treecet,treecet$tip.label[-match(names(brainmasscet), treecet$tip.label)])->treecet.multi
masscet[match(treecet.multi$tip.label,names(masscet))]->masscet.multi
# peform RRphylo on the variable (body mass) to be used as additional predictorRRphylo(tree=treecet.multi,y=masscet.multi,clus=cc)->RRmass.multi
RRmass.multi$aces[,1]->acemass.multi
# create the predictor vector: retrieve the ancestral character estimates# of body size at internal nodes from the RR object ($aces) and collate them# to the vector of species' body sizes to createc(acemass.multi,masscet.multi)->x1.mass
# peform RRphylo and search.trend on brain mass by using body mass as additional predictorRRphylo(tree=treecet.multi,y=brainmasscet,x1=x1.mass,clus=cc)->RRmulti
search.trend(RR=RRmulti, y=brainmasscet,x1=x1.mass,clus=cc)->STcet
## overfitST routine# generate a list of subsampled and swapped phylogenies to testtreecet.list<-resampleTree(RRmulti$tree,s =0.25,swap.si=0.1,swap.si2=0.1,nsim=10)# test the robustness of search.trend with and without x1.residualsofRRcet<-overfitRR(RR = RRmulti,y=brainmasscet,phylo.list=treecet.list,clus=cc,x1 =x1.mass)ofSTcet1<-overfitST(RR=RRmulti,y=brainmasscet,oveRR=ofRRcet,x1 =x1.mass,clus=cc)ofSTcet2<-overfitST(RR=RRmulti,y=brainmasscet,oveRR=ofRRcet,x1 =x1.mass,x1.residuals =TRUE,clus=cc)## End(Not run)
References
Castiglione, S., Tesone, G., Piccolo, M., Melchionna, M., Mondanaro, A., Serio, C., Di Febbraro, M., & Raia, P. (2018). A new method for testing evolutionary rate variation and shifts in phenotypic evolution. Methods in Ecology and Evolution, 9: 974-983.doi:10.1111/2041-210X.12954
Castiglione, S., Serio, C., Mondanaro, A., Di Febbraro, M., Profico, A., Girardi, G., & Raia, P. (2019a) Simultaneous detection of macroevolutionary patterns in phenotypic means and rate of change with and within phylogenetic trees including extinct species. PLoS ONE, 14: e0210101. https://doi.org/10.1371/journal.pone.0210101