/
Package`cati'March2,2020TypePackageTitleCommunityAssemblybyTraits:Indi Package`cati'March2,2020TypePackageTitleCommunityAssemblybyTraits:Indi

Package`cati'March2,2020TypePackageTitleCommunityAssemblybyTraits:Indi - PDF document

paisley
paisley . @paisley
Follow
343 views
Uploaded On 2020-11-23

Package`cati'March2,2020TypePackageTitleCommunityAssemblybyTraits:Indi - PPT Presentation

2AbToIndIndexByGroups16MinMaxMST17Neigbourhooddistancemetrics18partvar ID: 820917

ind finch traits plot finch ind plot traits true false null res col tstats val sample reg index listofindex

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Package`cati'March2,2020TypePackageTitle..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Package`cati'March2,2020TypePackageTitle
Package`cati'March2,2020TypePackageTitleCommunityAssemblybyTraits:IndividualsandBeyondVersion0.99.3Date2020-03-02AuthorAdrienTaudiere[aut,cre],CyrilleViolle[aut]withcontributionbyFrancoisMunoz[contr]MaintainerAdrienTaudiere­ri;n.t; udi;re@;&#xtuta;&#xnota;&#x.com;DependsR­ri;n.t; udi;re@;&#xtuta;&#xnota;&#x.com;(=3.5.0),nlme,ade4,ape,Importse1071,rasterVis,hypervolume,FD,geometry,veganSuggestslattice,spacodiR,entropart,fBasics,picante,mice,knitrDescriptionDetectandquantifycommunityassemblyprocessesusingtraitvaluesofindividualsorpopula-tions,theT-statistics(Violleetal.(2012) oi:;.1;/;&#xj.tr;î.2;.;.0;᐀)andothermet-rics,anddedicatednullmodelsdescribedinTaudiere&Violle(2016) oi:;.1;đ/;ìog;&#x.014;㌀LicenseGPL oi:;.1;đ/;ìog;&#x.014;㌀(=2)URLhttps://github.com/adrientaudiere/catiRoxygenNote6.0.1NeedsCompilationnoRepositoryCRANDate/Publication2020-03-0212:40:07UTCRtopicsdocumented:AbToInd...........................................2as.listondex........................................3Auxiliaryfunctions.....................................4ComIndex..........................................5ComIndexMulti.......................................9decompCTRE........................................13nch.ind.........................

..................15Fred................
..................15Fred.............................................1512AbToIndIndexByGroups.......................................16MinMaxMST........................................17Neigbourhooddistancemetrics...............................18partvar............................................19plot.listondex.......................................21plotCorTstats........................................23plotDistri..........................................24plotRandtest.........................................26plotSESvar.........................................27plotSpPop..........................................28plotSpVar..........................................30Pval.............................................32RandCom..........................................33RaoRel...........................................34samplingSubsetData....................................37ses..............................................38ses.listondex........................................40SumBL...........................................40traitex.anova........................................42Tstats............................................43Index49AbToIndInternalfunction.Transformabundancedatamatrixintoindividuallikematrix.DescriptionTransformabundancedatamatrixintoindividuallikematrixtoallowstheuseofComIndexandComI

ndexMultionpopulationnalorspecictrai
ndexMultionpopulationnalorspecictraitsvalues.UsageAbToInd(traits,com,type.sp.val="count")ArgumentstraitsIndividualMatrixoftraitswithtraitsincolumns."traits"matrixmusthaverownames(e.g.speciesorpopulationnalnames).comCommunitydatamatrixwithspeciesinrowsandsitesincolumn.type.sp.valEither"count"or"abundance".Useabundancewhenallvaluesinthecomma-trixarenotsuperiortoone.UsingabundanceisEXPERIMENTAL.Thisfunc-tionroundabundancetotcountdata.DetailsInternalfunctionas.listondex3ValueAlistofobjects:$traitsIndividualtraitsmatrix$spVectorofspeciesattributes$ind.plotVectorofsitesattributesAuthor(s)AdrienTaudiereas.listofindexTransformindexresultsinalistofindexDescriptionTransformvariousresultsfromfunctionsTstast,ComIndexorComIndexMultiinalistofindex.Usefultousethefunctionsplot.listondex(S3method)andses.listondex.Usageas.listofindex(x,namesindex=NULL)ArgumentsxAlistofobjectsofclassTstast,ComIndexorComIndexMultinamesindexOptionnal,thenamesofindexinthesameorderasinx.ValueAlistofobservedvaluesandcorresponding"null"values(i.e.producedbynullmodels)intheform"list(index1,nullmodelindex1,index2,nullmodelindex2...)"Author(s)AdrienTaudiereSeeAlsoses.listofindex;plot.listofindex4AuxiliaryfunctionsExamplesdata(finch.ind)res.finchTstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=9,print=FALSE)####Useadifferentregi

onalpoolthanthebindingofstudiedcommuniti
onalpoolthanthebindingofstudiedcommunities#createarandomregionalpoolfortheexamplereg.prbind(traits.finch,traits.finch[sample(1:2000,300),])res.finch2Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,reg.pool=reg.p,nperm=9,print=FALSE)plot(as.listofindex(list(res.finch,res.finch2)))####Useadifferentregionalpoolforeachcommunities#createarandomregionalpoolforeachcommunitiesfortheexamplelist.reg.plist(traits.finch[sample(1:290,200),],traits.finch[sample(100:1200,300),],traits.finch[sample(100:1500,1000),],traits.finch[sample(300:800,300),],traits.finch[sample(1000:2000,500),],traits.finch[sample(100:900,700),])#Warning:theregionalpoolneedtobelargerthantheobservedcommunitiestable(ind.plot.finch)#Forexemple,thethirdcommunityneedaregionalpoolofmorethan981individualsres.finch3Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,reg.pool=list.reg.p,nperm=9,print=FALSE)plot(as.listofindex(list(res.finch,res.finch2,res.finch3)))AuxiliaryfunctionsAuxiliaryfunctionsDescriptionAuxiliaryfunctionsUsagefunky.col(n)ComIndex5ArgumentsnnumberofcolorforthefunkypaletteDetailsfunky.colisacloneofthepalettefunkyfromtheadegenetpackage.ValueAcolorpaletteAuthor(s)ThibaultJombartComIndexComputingmetricstotestandquantifythenon-randomassemblyofcommunitiesDescriptionComputingthemomentsofthetraitdistributionandothermetricstotestandquantif

ythenon-randomassemblyofcommunities.Usag
ythenon-randomassemblyofcommunities.UsageComIndex(traits=NULL,index=NULL,nullmodels=NULL,ind.plot=NULL,sp=NULL,com=NULL,SE=0,namesindex=NULL,reg.pool=NULL,SE.reg.pool=NULL,nperm=99,printprogress=TRUE,independantTraits=TRUE,type.sp.val="count")##S3methodforclass'ComIndex'plot(x,type="normal",col.index=c("red","purple","olivedrab3"),add.conf=TRUE,color.cond=TRUE,val.quant=c(0.025,0.975),...)##S3methodforclass'ComIndex'print(x,...)##S3methodforclass'ComIndex'summary(object,...)6ComIndexArgumentstraitsIndividualMatrixoftraitswithtraitsincolumn(orspeciesmatrixwhenusing"com"insteadof"ind.plot").indexAvectoroffunctiontoapplytotraitsvectorsintheform"mean(x,na.rm=TRUE)"or"range(x)",seeexamplesformorecomplexefunctions.nullmodelsAvectorofnamescorrespondingtonullmodelstuuseforeachindex.local(or1)correspondstoarandomizationofindividualvalueswithinagivencom-munity.regional.ind(or2)correspondstorandomizationofindividualvalueswithinregion,iewithinallthedataset.Avalueofregional.pop(or2sp)cor-respondstorandomizationofpopulationvalues(eachindividualvaluearere-placedbythemeanvalueofitpopulation)withinregion.Finallyavalueofregional.pop.prab(or2sp.prab)mirrornullmodelregional.popbutwithouttakingindoaccountspeciesabundance.Forexample,ifnullmodels=c("local","regional.ind"),therstindexwillbecalculatedonthenullmodellocalandthesecondindexont

henullmodelregional.ind.Ifonlyonevalueis
henullmodelregional.ind.Ifonlyonevalueisgiven,allthethenullmodelwillbedeterminedbythisvalue.ind.plotFactordeningthenameoftheplot(siteorcommunity)inwhichtheindividualis.spFactordeningthespecieswhichtheindividualbelongto.comCommunitydatamatrixwithspecies(orpopulations)inrowsandsitesincol-umn.Useonlyifind.plot=NULL."traits"matrixand"com"matrixmusthavethesamenumberofrows.SEAsinglevalueorvectorofstandarderrorsassociatedwitheachtraits.Especiallyallowtohandlemeasurementerrors.Notusedwithpopulationalnullmodel.namesindexAvectorofnamesforindex.reg.poolRegionalpooldatafortraits.Ifnotinformed,traitsisconsidereastheregionalpool.Thismatrixneedtobelarger(morerows)thanthematrix"traits".Useonlyfornullmodelregional.ind.SE.reg.poolAsinglevalueorvectorofstandarderrorsassociatedwitheachtraitsineachregionalpool.Useonlyifreg.poolisused.Needtohavethesamedimensionasreg.pool.npermNumberofpermutations.IfNULL,onlyobservedvaluesarereturned.printprogressLogicalvalue;printprogressduringthecalculationornot.independantTraitsLogicalvalue(default:TRUE).IfindependantTraitsistrue(default),eachtraitsissampleindependentlyinnullmodels,ifnot,eachlinesofthematrixareran-domized,keepingtherelation(andtrade-off)amongtraits.type.sp.valOnlyifind.plot=NULL.Either"count"or"abundance".Useabundancewhenonevalueormoreinthecommatrixareinferiortoone.Usingabundanceis

EXPERIMENTAL.Thisfunctionroundabundancet
EXPERIMENTAL.Thisfunctionroundabundancetotcountdata.xAnobjectofclassComIndex.objectAnobjectofclassComIndex.typeTypeofplot.Possibletype="simple","simple_range","normal","barplot"and"bytraits".ComIndex7col.indexVectorofcolorsforindex.add.confLogicalvalue;Addcondenceintervalsornot.color.condLogicalvalue;Ifcolor.cond=TRUE,colorpointsindicateT-statisticsvaluessignicativelydifferentfromthenullmodelandgreypointsarenotdifferentfromnullmodel.val.quantNumericvectorsoflength2,givingthequantiletocalculatecondenceinterval.Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%....Anyadditionalargumentsarepassedtotheplot,printorsummaryfunction.Seeplot.listofindexformorearguments.DetailsComputestatistics(e.g.mean,range,CVNNDandkurtosis)totestcommunityassemblyusingnullmodels.Foreachstatisticthisfunctionreturnsobservedvaluesandtherelatednulldistribu-tion.Thisfunctionimplementfournullmodelswhichkeepunchangedthenumberofindividualpercommunity.Modellocal(1)correspondstorandomizationofindividualvalueswithincom-munity.Modelregional.ind(2)correspondstorandomizationofindividualvalueswithinregion.Modelregional.pop(2sp)correspondstorandomizationofpopulationvalueswithinregion.Modelregional.pop.prab(2sp.prab)correspondstorandomizationofpopulationvalueswithinregionbutwhitouttakingintoaccountforabundance.Inmostcases,modelsloca

landregional.indcorrespondtoindexatthein
landregional.indcorrespondtoindexattheindividuallevelandthemodelregional.popandregional.pop.prabtoindexatthespecieslevel(oranyotheraggregatevariablelikegenus,familyorfunctionnalgroup).S3methodplotforclasslistondex:-Normaltypeplotmeans,standarddeviations,rangesandcondenceintervalsofT-statistics.-Simple_rangetypeplotmeans,standarddeviationsandrangeofT-statistics-SimpletypeplotT-statisticsforeachsiteandtraitsandthemeancondenceintervalsbytraits-Barplottypeplotmeans,standarddeviationsandcondenceintervalsofT-statisticsinabarplotfashion-Bysitestypeploteachmetricsforeachsites-BytraitstypeploteachmetricsforeachtraitsValueAnobjectofclass"ComIndex"correspondingtoalistoflists:$obsListofobservedvaluesforeachtraitineachcommunity.Eachcomponentofthelistcorrespondstoamatrixcontainingtheresultforeachcustomfunction.$nullListofnullvaluesforeachtraitineachcommunity.Eachcomponentofthelistcorrespondstoanarraycontainingtheresultofthepermutationsforeachcustomfunction.$list.indexListofindexvaluesandrelatednullmodels.Internaluseinotherfunction.Traitsincolumns.$list.index.tListofindexvaluesandrelatednullmodels.Internaluseinotherfunction.Traitsinrows.8ComIndex$sites_richnessNumberofspeciespersite.$namestraitsNamesoftraits.$traitstraitsdata$ind.plotnameoftheplotinwhichtheindividualis$spgroups(e.g.species)whichtheindividualbelongto$n

ullmodelsListofnullmodelsusedforeachindi
ullmodelsListofnullmodelsusedforeachindices.$callcallofthefunctionTstatsAuthor(s)AdrienTaudiereSeeAlsoComIndexMulti;plot.listofindex;sesExamplesdata(finch.ind)#Definethefunctionsthatwillbecalculatingfunct((na.rm=TRUE)","kurtosis(x,na.rm=TRUE)","max(x,na.rm=TRUE)-min(x,na.rm=TRUE)")#Testagainstthenullmodelregional.indres.finch.sp_regional.ind(=traits.finch,index=funct,sp=sp.finch,nullmodels="regional.ind",ind.plot=ind.plot.finch,nperm=9,print=FALSE)#Testagainstthenullmodelregional.pop#Individualsvaluesaretransformedinpopulationalvaluesres.finch.sp_regional.pop(=traits.finch,index=funct,sp=sp.finch,nullmodels="regional.pop",ind.plot=ind.plot.finch,nperm=9,print=FALSE)#Wecancalculateindexwithorwithoutintraspecificvariance.#calculateofmeansbypopulation(name_sp_siteisanameofapopulation)#determinethesiteforeachpopulation(sites_bypop)name_sp_sites=paste(sp.finch,ind.plot.finch,sep="_")traits.by.pop(2,function(x)tapply(x,name_sp_sites,mean,na.rm=TRUE))sites_bypop(((()sep="_"),split="_"),function(x)x[3])ComIndexMulti9#Newlistoffunction"funct"funct.1((ind.plot.finch,function(x)mean(x,na.rm=TRUE))","tapply(x,ind.plot.finch,function(x)kurtosis(x,na.rm=TRUE))","tapply(x,ind.plot.finch,function(x)max(x,na.rm=TRUE)-min(x,na.rm=TRUE))","tapply(x,ind.plot.finch,function(x)CVNND(x,na.rm=TRUE))")fact()funct.2((fact,function(x)mean(x,na.r

m=TRUE))","tapply(x,fact,function(x)kurt
m=TRUE))","tapply(x,fact,function(x)kurtosis(x,na.rm=TRUE))","tapply(x,fact,function(x)max(x,na.rm=TRUE)-min(x,na.rm=TRUE))","tapply(x,fact,function(x)CVNND(x,na.rm=TRUE))")res.finch.withIV(=traits.finch,index=funct.1,sp=sp.finch,nullmodels="regional.ind",ind.plot=ind.plot.finch,nperm=9,print=FALSE)res.finch.withoutIV(=traits.finch,index=funct.2,sp=sp.finch,nullmodels="regional.pop",ind.plot=ind.plot.finch,nperm=9,print=FALSE)#ComIndexclassareassociatedtoS3methodsplot,printandsummary.res.finch.withIVsummary(res.finch.withIV)plot(res.finch.withIV)plot(res.finch.withoutIV)plot(as.listofindex(list(res.finch.withIV,res.finch.withoutIV)))ComIndexMultiComputingmultitraitsmetricstotestandquantifythenon-randomas-semblyofcommunitiesDescriptionComputingmultitraitsmetricstotestandquantifythenon-randomassemblyofcommunitiesUsageComIndexMulti(traits=NULL,index=NULL,by.factor=NULL,nullmodels=NULL,ind.plot=NULL,sp=NULL,com=NULL,SE=0,namesindex=NULL,reg.pool=NULL,SE.reg.pool=NULL,nperm=99,printprogress=TRUE,independantTraits=TRUE,type.sp.val="count")10ComIndexMulti##S3methodforclass'ComIndexMulti'plot(x,type="normal",col.index=c("red","purple","olivedrab3"),add.conf=TRUE,color.cond=TRUE,val.quant=c(0.025,0.975),...)##S3methodforclass'ComIndexMulti'print(x,...)##S3methodforclass'ComIndexMulti'summary(object,...)ArgumentstraitsIndividu

alMatrixoftraitswithtraitsincolumn(orspe
alMatrixoftraitswithtraitsincolumn(orspeciesmatrixwhenusing"com"insteadof"ind.plot").indexAvectoroffunctionstoapplytotraitsvectorsintheform"mean(x,na.rm=TRUE)"or"range(x)".by.factorAfactortosplittheMatrixoftraitsandcomputeindexforeachsubsetegforeachsite.nullmodelsAvectorofnamescorrespondingtonullmodelstuuseforeachindex.local(or1)correspondstoarandomizationofindividualvalueswithinagivencom-munity.regional.ind(or2)correspondstorandomizationofindividualvalueswithinregion,iewithinallthedataset.Avalueofregional.pop(or2sp)cor-respondstorandomizationofpopulationvalues(eachindividualvaluearere-placedbythemeanvalueofitpopulation)withinregion.Finallyavalueofregional.pop.prab(or2sp.prab)mirrornullmodelregional.popbutwithouttakingindoaccountspeciesabundance.Forexample,ifnullmodels=c("local","regional.ind"),therstindexwillbecalculatedonthenullmodellocalandthesecondindexonthenullmodelregional.ind.Ifonlyonevalueisgiven,allthethenullmodelwillbedeterminedbythisvalue.ind.plotFactordeningthenameoftheplot(siteorcommunity)inwhichtheindividualis.spFactordeningthespecieswhichtheindividualbelongto.comCommunitydatamatrixwithspecies(orpopulations)inrowsandsitesincol-umn.Useonlyifind.plot=NULL."traits"matrixand"com"matrixmusthavethesamenumberofrows.SEAsinglevalueorvectorofstandarderrorsassociatedwitheachtraits.Especiallyallowtohandlem

easurementerrors.Notusedwithpopulational
easurementerrors.Notusedwithpopulationalnullmodel.namesindexAvectorofnamesformetrics.reg.poolRegionalpooldatafortraits.Ifnotinformed,traitsisconsidereastheregionalpool.Thismatrixneedtobelarger(morerows)thanthematrix"traits".Useonlyfornullmodel2.SE.reg.poolAsinglevalueorvectorofstandarderrorsassociatedwitheachtraitsineachregionalpool.Useonlyifreg.poolisused.Needtohavethesamedimensionasreg.pool.ComIndexMulti11npermNumberofpermutations.IfNULL,onlyobservedvaluesarereturned.printprogressLogicalvalue;printprogressduringthecalculationornot.independantTraitsLogicalvalue(default:TRUE).IfindependantTraitsistrue(default),eachtraitsissampleindependentlyinnullmodels,ifnot,eachlinesofthematrixareran-domized,keepingtherelation(andtrade-off)amongtraits.type.sp.valOnlyifind.plot=NULL.Either"count"or"abundance".Useabundancewhenallvaluesinthecommatrixarenotsuperiortoone.xAnobjectofclassComIndexMulti.objectAnobjectofclassComIndexMulti.typeTypeofplot.Possibletype="simple","simple_range","normal","barplot"and"bytraits".col.indexVectorofcolorsforindex.add.confLogicalvalue;Addcondenceintervalsornot.color.condLogicalvalue;Ifcolor.cond=TRUE,colorpointsindicateT-statisticsvaluessignicativelydifferentfromthenullmodelandgreypointsarenotdifferentfromnullmodel.val.quantNumericvectorsoflength2,givingthequantiletocalculatecondenceinterval.

Bydefaultval.quant=c(0.025,0.975)forabil
Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%....Anyadditionalargumentsarepassedtotheplot,printorsummaryfunctioncre-atingthecoreoftheplotandcanbeusedtoadjustthelookofresultinggraph.Seeplot.listofindexformorearguments.DetailsThisfunctionimplementfournullmodelswhichkeepunchangedthenumberofindividualpercommunity.Modellocal(1)correspondstorandomizationofindividualvalueswithincommunity.Modelregional.ind(2)correspondstorandomizationofindividualvalueswithinregion.Modelregional.pop(2sp)correspondstorandomizationofpopulationvalueswithinregion.Modelre-gional.pop.prab(2sp.prab)correspondstorandomizationofpopulationvalueswithinregionbutwhitouttakingintoaccountforabundance.S3methodplotforclasslistondex:-Normaltypeplotmeans,standarddeviations,rangesandcondenceintervalsofT-statistics.-Simple_rangetypeplotmeans,standarddeviationsandrangeofT-statistics-SimpletypeplotT-statisticsforeachsiteandtraitsandthemeancondenceintervalsbytraits-Barplottypeplotmeans,standarddeviationsandcondenceintervalsofT-statisticsinabarplotfashion-Bysitestypeploteachmetricsforeachsites-Bytraitstypeploteachmetricsforeachtraits12ComIndexMultiValueAlistoflists:$obsListofobservedvaluesforeachtraitineachcommunity.Eachcomponentofthelistcorrespondtoamatrixcontainingtheresultforeachcustomfunction.$nullListofnullvaluesforeachtraitineachc

ommunity.Eachcomponentofthelistcorrespon
ommunity.Eachcomponentofthelistcorrespondtoanarraycontainingtheresultofthepermutationsforeachcustomfunction.$sites_richnessNumberofspeciespersite.$namestraitsNamesoftraits.$traitstraitsdata$ind.plotnameoftheplotinwhichtheindividualis$spgroups(e.g.species)whichtheindividualbelongto$nullmodelsListofnullmodelsusedforeachindices.$callcallofthefunctionTstats$list.indexListofindexvaluesandassociatenullmodels.Internaluseinotherfunction.Traitsincolumns.$list.index.tListofindexvaluesandassociatenullmodels.Internaluseinotherfunction.Traitsinrows.Author(s)AdrienTaudiereSeeAlsoComIndex;plot.listofindex;sesExamplesdata(finch.ind)#Formostmultivariatefunctionsweneedtoreplace(orexclude)NAvalues.#Forthisexample,weusethepackagemicetocompletethedata.comm((()))library(mice)traits=traits.finchmice()traits.finch.mice()#AsimpleexampletoillustratetheconceptofthefunctionComIndexMultidecompCTRE13n_sp_plot((ind.plot.finch,sep="_"))res.sum.1(index=c("sum(scale(x),na.rm=T)","sum(x,na.rm=T)"),by.factor=n_sp_plot,nullmodels="regional.ind",ind.plot=ind.plot.finch,nperm=9,sp=sp.finch)res.sum.1#Amoreinterestingexampleusingthefunctionhypervolumelibrary(hypervolume)hv(reps=100,bandwidth=0.2,verbose=F,warnings=F)plot(hv)hv.1(index=c("as.numeric(try(hypervolume(na.omit(x),reps=100,bandwidth=0.2,verbose=F,warnings=F)@Volume))"),by.factor=rep(1,length(n_sp_p

lot)),nullmodels="regional.ind",ind.plot
lot)),nullmodels="regional.ind",ind.plot=ind.plot.finch,nperm=9,sp=sp.finch)hv.1decompCTREVariancepartitioningformultipletraitsDescriptionThisfunctiondecomposesthevariationincommunitytraitcompositionintothreesources:(i)theintraspecictraitvariability,(ii)thevariabilityduetospeciesturnoverand(iii)theircovariationisalsoseparated.Thisdecompositioniscomputedforthewholevariationinthetraitvaluesand,Theformulaspecied,acrossthecontributionofvariousexplanatoryvariablesconsideredinthemodel.Barplot.decompCTREallowtoplottheresultofthedecomposition.UsagedecompCTRE(traits=NULL,formula=~1,ind.plot=NULL,sp=NULL,printprogress=TRUE,...)##S3methodforclass'decompCTRE'barplot(height,resume=TRUE,...)ArgumentstraitsMatrixoftraitswithtraitsincolumn14decompCTREheightAnobjectofclassdecompCTREobtainbythefunctiondecompCTRE.formulaTheformulaparametermustbeaone-sidedformula,i.e.startingwithatilde(~)character.Theresponsevariableisspeciedbythenexttwoarguments,specif.avgandconst.avg.Bydefaultsetto~1.ind.plotFactordeningthenameoftheplot(siteorcommunity)inwhichtheindividualis.spFactordeningthespecieswhichtheindividualbelongto.printprogressLogicalvalue;printprogressduringthecalculationornot.resumeLogical.Ifresume=FALSE,plotonegraphicbytraits....OptionaladditionalargumentsValueAnobjectofclass"decompCTRE".Author(s)AdrienTaudiereJanLeps

ReferencesLeps,Jan,FrancescodeBello,Petr
ReferencesLeps,Jan,FrancescodeBello,PetrSmilauerandJiriDolezal.2011.Communitytraitresponsetoenvironment:disentanglingspeciesturnovervsintraspecictraitvariabilityeffects.Ecography34(5):856-863.SeeAlsobarplot.decompCTRE;traitflex.anovaExamplesdata(finch.ind)res.decompdecompCTRE(traits=traits.finch,sp=sp.finch,ind.plot=ind.plot.finch,print=FALSE)barplot.decompCTRE(res.decomp)par(mfrow=c(2,2))barplot.decompCTRE(res.decomp,resume=FALSE)par(mfrow=c(1,1))nch.ind15finch.indFinchmorphologicaldataDescriptionIndividualmorphologicaldataforDarwin"snches.nchisthealldata.frame.ind.plot.nchandsp.nchrespectivelycorrespondtotheIlslandandthespeciesattributeofeachindividual.traits.nchisthematrixoftraitswithfourtraitsinrowsand2677individualsincolumns.Usagedata(finch.ind)FormatAdata.frameof2677individualsinrowsand14columns.DetailsSeehttp://bioquest.org/birdd/morph.phpformoreinformationondatabase.Sourcehttp://bioquest.org/birdd/morph.phpExamplesdata(finch.ind)FredFunctionalrichness,evennessanddivergencefollowingVillegeretal.2008DescriptionComputethe3functionaldiversityindices(multi-traits)presentedinVillegeretal.2008(Ecology892290-2301):Functionalrichness(FRic),Functionalevenness(FEve),Functionaldivergence(FDiv)UsageFred(traits,ind.plot)ArgumentstraitsIndividualMatrixoftraitswithtraitsincolumns.NAarenotallowed

.ind.plotFactordeningthenameoftheplo
.ind.plotFactordeningthenameoftheplotinwhichtheindividualis.16IndexByGroupsDetailsForeachtrait,valuesarestandardized(mean=0andstandarddeviation=1)ForFRiccomputation,numberofindividualsmustbehigherthannumberoftraitsValuelistof4vectorswithvaluesofindicesineachsites$nbindnumberofindividuals$FRicfunctionalrichnessindex$FEvefunctionalevennessindex$FDivfunctionaldivergenceindexAuthor(s)SebastienVillegersligthymodiedbyAdrienTaudiereSeeAlsoComIndexMultiComIndexExamplesdata(finch.ind)#Formostmultivariatefunctionsweneedtoreplace(orexclude)NAvalues.#Forthisexample,weusethepackagemicetocompletethedata.comm((()))library(mice)traits=traits.finchmice()traits.finch.mice()fred(ind.plot.finch)IndexByGroupsApplymetricstogroups.DescriptionTransformealistofmetricstoapplythemtogroups,typicallytopopulations.UsageIndexByGroups(metrics,groups)MinMaxMST17ArgumentsmetricsAvectorofmetricsliketheargument"index"offunctionComIndexgroupsNameofthefactortoapplythemetricstogroupsintheform"pop",e.g.popu-lationValueAvectoroftransformedmetricsAuthor(s)AdrienTaudiereMinMaxMSTRatiooftheshortestdistancetothelongestdistanceinaminimumspanningtreeDescriptionRatiooftheshortestdistancetothelongestdistanceinaminimumspanningtree.UsageMinMaxMST(traits,gower.dist=TRUE,scale.tr=TRUE,method.dist="euclidian")ArgumentstraitsTraitsmatrix(traitsincolumn)gower.d

istCalculategowerdistanceusingthefunctio
istCalculategowerdistanceusingthefunctiongowdisfrompackageFD.scale.trDoestraitsneedtobescalebeforemulti-traitsmetriccalculation?Onlyusewhengower.dist=FALSE.Defaultisyes.method.distMethodtocalculatethedistanceincaseofmulti-traitsmetric(functiondist).Onlyusewhengower.dist=FALSE.Defaultiseuclidian.ValueThevalueoftheratiooftheshortestdistancetothelongestdistanceinaminimumspanningtree.Author(s)Aibaetal.,2013modiedbyAdrienTaudiereReferencesStubbs,WJ.,andWilson,JB.2004.Evidenceforlimitingsimilarityinasanddunecommunity.JournalofEcology92:557-567.Aiba,M.,Katabuchi,M.,Takafumi,H.,Matsuzaki,S.S.,Sasaki,T.&Hiura,T.2013.Robustnessoftraitdistributionmetricsforcommunityassemblystudiesundertheuncertaintiesofassemblyprocesses.Ecology,94,2873-2885.18NeigbourhooddistancemetricsExamplesdata(finch.ind)MinMaxMST(traits.finch[1:10,])MinMaxMST(traits.finch[1:10,],gower.dist=FALSE)MinMaxMST(traits.finch[1:10,],gower.dist=FALSE,scale.tr=FALSE)NeigbourhooddistancemetricsCoefcientofvariation,mean,minimumandstandarddeviationofthenearestneigbourhooddistance.DescriptionCVNND:CoefcientofvariationofthenearestneigbourhooddistanceMNND:MeanofthenearestneigbourhooddistanceMinNND:MinimumofthenearestneigbourhooddistanceSDNND:StandarddeviationofthenearestneigbourhooddistanceSDND:StandarddeviationoftheneigbourhooddistanceMND:Meanoftheneigbourhoo

ddistanceUsageCVNND(traits,div_range=FAL
ddistanceUsageCVNND(traits,div_range=FALSE,na.rm=FALSE,scale.tr=TRUE,method.dist="euclidian")MNND(traits,div_range=FALSE,na.rm=FALSE,scale.tr=TRUE,method.dist="euclidian")MinNND(traits,div_range=FALSE,na.rm=FALSE,scale.tr=TRUE,method.dist="euclidian")SDNND(traits,div_range=FALSE,na.rm=FALSE,scale.tr=TRUE,method.dist="euclidian")SDND(trait,div_range=FALSE,na.rm=FALSE)MND(trait,div_range=FALSE,na.rm=FALSE)partvar19ArgumentstraitsTraitvector(uni-traitmetric)ortraitsmatrix(Multi-traitsmetric),traitsincol-umn.traitTraitvectordiv_rangeDoesmetricneedtobedividedbytherange?Defaultisno.na.rmIfdiv_range=TRUE,alogicalvalueindicatingwhetherNAvaluesshouldbestrippedbeforethecomputationproceeds.scale.trDoestraitsneedtobescalebeforemulti-traitsmetriccalculation?Defaultisyes.method.distMethodtocalculatethedistanceincaseofmulti-traitsmetric(functiondist).Defaultiseuclidian.ValueOnevaluecorrespondingtothemetricvalue.Author(s)AdrienTaudiereReferencesAiba,M.,Katabuchi,M.,Takafumi,H.,Matsuzaki,S.S.,Sasaki,T.&Hiura,T.2013.Robustnessoftraitdistributionmetricsforcommunityassemblystudiesundertheuncertaintiesofassemblypro-cesses.Ecology,94,2873-2885.Jung,Vincent,CyrilleViolle,CedricMondy,LucienHoffmann,etSergeMuller.2010.Intraspecicvariabilityandtrait-basedcommunityassembly:Intraspecicvariabilityandcommunityassembly.JournalofEcology98(5):

1134-1140.Examplesdata(finch.ind)CVNND(t
1134-1140.Examplesdata(finch.ind)CVNND(traits.finch[,1],na.rm=TRUE)CVNND(traits.finch[,1],div_range=TRUE,na.rm=TRUE)CVNND(traits.finch,na.rm=TRUE)CVNND(traits.finch,scale.tr=FALSE,na.rm=TRUE)SDND(traits.finch[,1],na.rm=TRUE)partvarVariancepartitioningaccrossnestedscalesDescriptionVariancepartitioningaccrossnestedscalesusingadecomposition(varcompfunction)ofvarianceonrestrictedmaximumlikelihood(REML)method(lmefunction).SeeMessieretal.2010formoreinformation.barPartvarandpiePartvarareassociatedplottingfunctions.20partvarUsagepartvar(traits,factors,printprogress=TRUE)barPartvar(partvar,col.bar=NA,...)piePartvar(partvar,col.pie=NA,...)ArgumentstraitsMatrixoftraitswithtraitsincolumnfactorsAmatrixoffactorswiththerstcolumncorrespondstothehigherlevelfactor,thesecondrowthesecondhigherlevelfactorandsoon.printprogressLogicalvalue;printprogressduringthecalculationornot.partvarTheresultofthepartvarfunction.col.barVectorofcolorsofbars...Anyadditionalargumentsarepassedtothepiefunction.col.pieVectorofcolorforpie.ValueAnobjectofclass"partvar"correspondingtoamatrixofvariancevalueswithtraitsinrowsandnestedfactorsincolumn.Author(s)AdrienTaudiereJulieMessierReferencesMessier,Julie,BrianJ.McGill,etMartinJ.Lechowicz.2010.Howdotraitsvaryacrossecologicalscales?Acasefortrait-basedecology:Howdotraitsvaryacrossecologicalscales?EcologyLetters1

3(7):838-848.doi:10.1111/j.1461-0248.201
3(7):838-848.doi:10.1111/j.1461-0248.2010.01476.x.SeeAlsopiePartvar;barPartvarExamplesdata(finch.ind)cond(()by=2)genusas.vector(unlist(strsplit(as.vector(sp.finch),"_"))[cond])res.partvar.finchpartvar(traits=traits.finch,factors=cbind(sites=as.factor(as.vector(ind.plot.finch)),species=as.factor(as.vector(sp.finch)),genus=as.factor(genus)))res.partvar.finchplot.listondex21oldpar()par(mfrow=c(2,2),mai=c(0.2,0.2,0.2,0.2))piePartvar(res.partvar.finch)par(oldpar)barPartvar(res.partvar.finch)plot.listofindexPlotcommunityassemblyindexDescriptionPlotcommunityassemblyindexandcondenceintervalsusingalistofindex.S3methodforclasslistondex.Usage##S3methodforclass'listofindex'plot(x,type="normal",col.index=c("red","purple","olivedrab3"),add.conf=TRUE,color.cond=TRUE,val.quant=c(0.025,0.975),grid.v=TRUE,grid.h=TRUE,xlim=NULL,ylim=NULL,cex.text=0.8,plot.ask=FALSE,srt.text=90,alpha=0.4,...)ArgumentsxAlistofindexandrelatednullmodelsobtainedfromtotheas.listondexfunc-tion.typeTypeofplot.Possibletype="simple","simple_range","normal","barplot"and"bytraits".col.indexVectorofcolorsforindex.add.confLogicalvalue;Addcondenceintervalsornot.color.condLogicalvalue;Ifcolor.cond=TRUE,colorpointsindicateT-statisticsvaluessignicativelydifferentfromthenullmodelandgreypointsarenotdifferentfromnullmodel.val.quantNumericvectorsofle

ngth2,givingthequantiletocalculatecon
ngth2,givingthequantiletocalculatecondenceinterval.Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%.grid.vLogicalvalue;printverticalgridornotgrid.hLogicalvalue;printhorizontalgridornotxlimNumericvectorsoflength2,givingthexcoordinatesrangeylimNumericvectorsoflength2,givingtheycoordinatesrangecex.textNumericvalue;themagnicationtobeusedfortextrelativetothecurrentsettingofcex22plot.listondexplot.askLogicalvalue;askforplottingthenextplotornot.srt.textDegreeofrotationfortext.alphaDegreeoftransparencyfornullmodelsaera....Anyadditionalargumentsarepassedtotheplotfunctioncreatingthecoreoftheplotandcanbeusedtoadjustthelookofresultinggraph.DetailsS3methodplotforclasslistondex:-Normaltypeplotmeans,standarddeviations,rangesandcondenceintervalsofT-statistics.-Simple_rangetypeplotmeans,standarddeviationsandrangeofT-statistics-SimpletypeplotT-statisticsforeachsiteandtraitsandthemeancondenceintervalsbytraits-Barplottypeplotmeans,standarddeviationsandcondenceintervalsofT-statisticsinabarplotfashion-Bysitestypeploteachmetricsforeachsites-BytraitstypeploteachmetricsforeachtraitsValueNone;usedfortheside-effectofproducingaplot.Author(s)AdrienTaudiereSeeAlsoas.listofindex;plot.Tstats;ses.listofindexExamplesdata(finch.ind)res.finchTstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=9,print=FA

LSE)####Useadifferentregionalpoolthanthe
LSE)####Useadifferentregionalpoolthanthebindingofstudiedcommunities#createarandomregionalpoolfortheexamplereg.prbind(traits.finch,traits.finch[sample(1:2000,300),])res.finch2Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,reg.pool=reg.p,nperm=9,print=FALSE)plot(as.listofindex(list(res.finch,res.finch2)))####Useadifferentregionalpoolforeachcommunities#createarandomregionalpoolforeachcommunitiesfortheexamplelist.reg.plist(plotCorTstats23traits.finch[sample(1:290,200),],traits.finch[sample(100:1200,300),],traits.finch[sample(100:1500,1000),],traits.finch[sample(300:800,300),],traits.finch[sample(1000:2000,500),],traits.finch[sample(100:900,700),])#Warning:theregionalpoolneedtobelargerthantheobservedcommunitiestable(ind.plot.finch)#Forexemple,thethirdcommunityneedaregionalpoolofmorethan981individualsres.finch3Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,reg.pool=list.reg.p,nperm=9,print=FALSE)plot(as.listofindex(list(res.finch,res.finch2,res.finch3)))plotCorTstatsPlotthebivariaterelationshipsbetweenT-statisticsDescriptionPlotthebivariaterelationshipsbetweenthethreeT-statisticsnamelyT_IP.IC,T_IC.IRandT_PC.PR.UsageplotCorTstats(tstats=NULL,val.quant=c(0.025,0.975),add.text=FALSE,bysite=FALSE,col.obj=NULL,plot.ask=TRUE,multipanel=TRUE,...)ArgumentststatsThelistresultingfromthefunctionTstats.val.quantNumer

icvectoroflength2,givingthequantiletocal
icvectoroflength2,givingthequantiletocalculatecondenceinterval.Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%.add.textLogicalvalue;Addtextornot.bysiteLogicalvalue;plotpersiteorbytraits.col.objVectorofcolorsforobject(eithertraitsorsites).plot.askLogicalvalue;Askfornewplotornot.multipanelLogicalvalue.IfTRUEdividesthedevicetoshownseveraltraitsgraphicsinthesamedevice....Anyadditionalargumentsarepassedtotheplotfunctioncreatingthecoreoftheplotandcanbeusedtoadjustthelookofresultinggraph.ValueNone;usedfortheside-effectofproducingaplot.24plotDistriAuthor(s)AdrienTaudiereSeeAlsoTstats;plot.Tstats;plotSESvarExamplesdata(finch.ind)res.finchTstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=9)plotCorTstats(res.finch,bysite=FALSE)plotCorTstats(res.finch,bysite=TRUE)plotDistriPlotfunctiontorepresentdensityoftraitvaluesDescriptionPlotfunctiontorepresentdensityoftraitvaluesUsageplotDistri(traits=NULL,var.1=NULL,var.2=NULL,col.dens=NULL,plot.ask=TRUE,ylim.cex=1,cex.leg=0.8,polyg=TRUE,multipanel=TRUE,leg=TRUE,xlim=NULL,ylim=NULL,main="default",...)ArgumentstraitsMatrixoftraitswithtraitsincolumn.var.1Therstvariabledenesthedivisionofeachplots,inmostcaseeitheravectorofspeciesornameofsites.var.2Thesecondvariabledenethedivisionbycolor,inmostcaseeitheravectorofspeciesornameofsites.col.densAvectorofc

olorsforthesecondvariable.plot.askLogica
olorsforthesecondvariable.plot.askLogicalvalue;askforplottingthenextplotornot.ylim.cexNumericvalue;themagnicationtobeusedforrangeofyaxecex.legNumericvalue;themagnicationtobeusedforlegendrelativetothecurrentsettingofcexpolygLogicalvalue;dothemeandistributionisfulloremptyplotDistri25multipanelLogicalvalue.IfTRUEdividesthedevicetoshownseveraltraitsgraphicsinthesamedevice.legLogicalvalue;ifTRUEprintthelegend.ylimNumericvectorsoflength2,givingtheycoordinatesrangexlimNumericvectorsoflength2,givingtheycoordinatesrangemainTitlefortheplot.Defaultsetautomatictitleusinginformationsintheinputdataset....Anyadditionalargumentsarepassedtotheplotfunctioncreatingthecoreoftheplotandcanbeusedtoadjustthelookofresultinggraph.ValueNone;usedfortheside-effectofproducingaplot.Author(s)AdrienTaudiereSeeAlsoplotSpPopExamplesdata(finch.ind)#Plotthedistributionoftraitvaluesforpopulations,#species,sitesandregionalscales.###First,lettrythedistributionforallpopulations#ofDarwinfinches.par(mfrow=c(4,4),cex=0.5)plotDistri(traits.finch,sp.finch,ind.plot.finch,ylim.cex=3,plot.ask=FALSE,multipanel=FALSE,leg=FALSE)###Thenwecaninversethesecondandthethirdarguments#toplotthedistributionforallfinchesspecies.par(mfrow=c(4,4),cex=0.5)plotDistri(traits.finch,ind.plot.finch,sp.finch,ylim.cex=8,plot.ask=FALSE,multipanel=FALSE,leg=FALSE)###Onlyonetraittoplot

usingleg=TRUEtoplotthelegendpar(mfrow=c(
usingleg=TRUEtoplotthelegendpar(mfrow=c(2,3))plotDistri(as.matrix(traits.finch[,1]),ind.plot.finch,sp.finch,ylim.cex=8,plot.ask=FALSE,multipanel=FALSE,leg=TRUE,cex.leg=0.5)26plotRandtest###Youcanalsoplottraitdistributionforallspeciesintheregionpar(mfrow=c(1,1),cex=1)plotDistri(traits.finch,rep("region",times=dim(traits.finch)[1]),sp.finch,ylim.cex=6,plot.ask=FALSE,leg=FALSE)###Youcanalsoplottraitdistributionforallsites#withouttakingintoaccountspeciesidentityplotDistri(traits.finch,rep("toutes_sp",times=dim(traits.finch)[1]),ind.plot.finch,ylim.cex=3,plot.ask=FALSE)plotRandtestPlotresultofobservedindicesvaluesagainstnulldistributionDescriptionFunctiontoplotresultofobservedindicesvaluesagainstnulldistribution.UsageplotRandtest(x,alternative="two-sided",...)ArgumentsxAnobjectofclasslistondex,ComIndex,ComIndexMultiorTstats.alternativeIndicatesthealternativehypothesisandmustbeoneof"two.sided","greater"or"less".Youcanspecifyjusttheinitialletter."greater"correspondstopositiveassociation,"less"tonegativeassociation....Anyadditionalargumentsarepassedtotheplotfunctioncreatingthecoreoftheplotandcanbeusedtoadjustthelookofresultinggraph.ValueNone;usedfortheside-effectofproducingaplot.Author(s)AdrienTaudiereSeeAlsoComIndex;ComIndexMulti;Tstats;as.listofindex;plot.listofindexplotSESvar27Examplesdata(finch.ind)res.finchTstats(t

raits.finch,ind.plot=ind.plot.finch,sp=s
raits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=99,print=FALSE)par(mfrow=c(4,4))plotRandtest(res.finch)plotRandtest(res.finch,alter="less")plotSESvarPlotSESvaluesagainstavariableDescriptionPlotstandardizedeffectsizevaluesagainstavariableUsageplotSESvar(index.list,variable=NULL,ylab="variable",color.traits=NULL,val.quant=c(0.025,0.975),resume=FALSE,multipanel=TRUE)Argumentsindex.listAlistofindexandtheassociatenullmodelsintheforme:list(index_1=in-dex_1_observed,index_1_nm=null.model.index_1,index_2=index_2_observed,index_2_nm=null.model.index_2,...).variableThevariableagainststandardizedeffectsizesareplotted.ylabLabelforthevariable.color.traitsAvectorofcolorscorrespondingtotraits.val.quantNumericvectorsoflength2,givingthequantiletocalculationcondencein-terval.Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%.resumeLogicalvalue;resume=FALSEbydefault;SimplifytheplotbyplottingthemeanandstandarderrorforindexvalueofmultipletraitsmultipanelLogicalvalue.IfTRUEdividesthedevicetoshownseveraltraitsgraphicsinthesamedevice.ValueNone;usedfortheside-effectofproducingaplot.28plotSpPopAuthor(s)AdrienTaudiereSeeAlsoplot.listofindex;sesExamplesdata(finch.ind)res.finchTstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=9)par(mfrow=c(2,2))species.richnesstable(ind.plot.finch)plotSESvar(as.listofindex(list(

res.finch)),species.richness,multipanel=
res.finch)),species.richness,multipanel=FALSE)#Sameplotwithresume=TRUE.par(mfrow=c(2,2))plotSESvar(as.listofindex(list(res.finch)),species.richness,resume=TRUE,multipanel=FALSE)par(mfrow=c(1,1))plotSpPopPlotpopulationsvaluesagainstspeciesvaluesDescriptionPlotpopulationsvaluesagainstspeciesvalues.Theobjectifistoseethecontributionofintra-specicvsinter-specicvariationtotraitgradient.UsageplotSpPop(traits=NULL,ind.plot=NULL,sp=NULL,col.ind=rgb(0.5,0.5,0.5,0.5),col.pop=NULL,col.sp=NULL,col.site=NULL,resume=FALSE,p.val=0.05,min.ind.signif=10,multipanel=TRUE,col.nonsignif.lm=rgb(0,0,0,0.5),col.signif.lm=rgb(1,0.1,0.1,0.8),silent=FALSE)ArgumentstraitsIndividualMatrixoftraitswithtraitsincolumns.ind.plotFactordeningthenameoftheplotinwhichtheindividualis.spFactordeningthespecieswhichtheindividualbelongto.plotSpPop29col.indColorforindividualvalues.col.popColorforpopulationalmeanvalues.col.spColorforspeciesmeanvalues.col.siteColorforsitesmeanvalues.resumeLogical,ifTRUEplotasimpleformoftheplot.p.valChoosenp.valuetoprintsignicantlinearrelationshipusinglinearmodel.Ar-gumentpasttothelmfuntioninternally.min.ind.signifMinimumindividualtoprintsignicantlinearrelationship.multipanelLogicalvalue.IfTRUEdividesthedevicetoshownseveraltraitsgraphicsinthesamedevice.col.nonsignif.lmColorfornonsignicantlinearrelationsh

ip.col.signif.lmColorforsignicantlin
ip.col.signif.lmColorforsignicantlinearrelationship.silentLogicalvalue,ifresume=FALSEdonotprintwarningargument.DetailsExampleofutilisation:Cornwell,W.K.,Ackerly,D.D.,2009.CommunityassemblyandshiftsinplanttraitdistributionsacrossanenvironmentalgradientincoastalCalifornia.EcologicalMono-graphs79,109-126.ValueNone;usedfortheside-effectofproducingaplot.Author(s)AdrienTaudiereSeeAlsoplotDistriExamplesdata(finch.ind)plotSpPop(traits.finch,ind.plot.finch,sp.finch,silent=TRUE)#Ifwechangethevalueofthethreshold#(alpha=10%insteadof5%#andtheminimumindividualtorepresentsignificativity#fixedto3insteadof10bydefault)#wecanseesomesignificantrelationships.plotSpPop(traits.finch,ind.plot.finch,sp.finch,p.val=0.1,min.ind.signif=3,silent=TRUE)30plotSpVar#Foramoresimplefigure,addtheoptionresume=TRUE.#Againifwechangethevalueofthethreshold#(alpha=10%insteadof5%#andtheminimumindividualtorepresentsignificativity#fixedto3insteadof10bydefault)#wecanseesomesignificantrelationships.plotSpPop(traits.finch,ind.plot.finch,sp.finch,silent=TRUE,resume=TRUE,col.pop="grey")plotSpPop(traits.finch,ind.plot.finch,sp.finch,silent=TRUE,resume=TRUE,col.pop="grey",col.sp="black")plotSpPop(traits.finch,ind.plot.finch,sp.finch,silent=TRUE,resume=TRUE,col.pop="grey",col.sp="black",p.val=0.1,min.ind.signif=3)plotSpVarPlotpopulationsvaluesagainstspeciesvaluesDe

scriptionPlotpopulationsvaluesagainstspe
scriptionPlotpopulationsvaluesagainstspeciesvalues.Theobjectifistoseethecontributionofintra-specicvsinter-specicvariationtotraitgradient.UsageplotSpVar(traits=NULL,ind.plot=NULL,sp=NULL,variable=NULL,col.ind=rgb(0.5,0.5,0.5,0.5),col.pop=NULL,col.sp=NULL,col.site=NULL,resume=FALSE,p.val=0.05,min.ind.signif=10,multipanel=TRUE,col.nonsignif.lm=rgb(0,0,0,0.5),col.signif.lm=rgb(1,0.1,0.1,0.8),silent=FALSE)ArgumentstraitsIndividualMatrixoftraitswithtraitsincolumns.ind.plotFactordeningthenameoftheplotinwhichtheindividualis.spFactordeningthespecieswhichtheindividualbelongto.variableAmatrixofvariablescorrespondingtoeachsite(inrows)andeachtrait(incolumns).Ifyouwanttoplotalltraitsagainstonevariable,variablecanbeavectorofnumericalvalues.col.indColorforindividualvalues.col.popColorforpopulationalmeanvalues.col.spColorforspeciesmeanvalues.plotSpVar31col.siteColorforsitesmeanvalues.resumeLogical,ifTRUEplotasimpleformoftheplot.p.valChoosenp.valuetoprintsignicantlinearrelationshipusinglinearmodel.Ar-gumentpasttothelmfuntioninternally.min.ind.signifMinimumindividualtoprintsignicantlinearrelationship.multipanelLogicalvalue.IfTRUEdividesthedevicetoshownseveraltraitsgraphicsinthesamedevice.col.nonsignif.lmColorfornonsignicantlinearrelationship.col.signif.lmColorforsignicantlinearrelationship.silentLogicalval

ue,ifresume=FALSEdonotprintwarningargume
ue,ifresume=FALSEdonotprintwarningargument.ValueNone;usedfortheside-effectofproducingaplot.Author(s)AdrienTaudiereSeeAlsoplotDistriExamplesdata(finch.ind)#Randomvariableforthisexamplevariablec(1,5,15,6,3,25)plotSpVar(traits.finch,ind.plot.finch,sp.finch,variable,silent=TRUE)#Ifwechangethevalueofthethreshold#(alpha=10%insteadof5%#andtheminimumindividualtorepresentsignificativity#fixedto3insteadof10bydefault)#wecanseesomesignificantrelationships.plotSpVar(traits.finch,ind.plot.finch,sp.finch,variable,p.val=0.1,min.ind.signif=3,silent=TRUE)#Foramoresimplefigure,addtheoptionresume=TRUE.#Againifwechangethevalueofthethreshold#(alpha=10%insteadof5%#andtheminimumindividualtorepresentsignificativity#fixedto3insteadof10bydefault)32Pval#wecanseesomesignificantrelationships.plotSpVar(traits.finch,ind.plot.finch,sp.finch,variable,silent=TRUE,resume=TRUE,col.pop="grey")plotSpVar(traits.finch,ind.plot.finch,sp.finch,variable,silent=TRUE,resume=TRUE,col.pop="grey",col.sp="black")plotSpVar(traits.finch,ind.plot.finch,sp.finch,variable,silent=TRUE,resume=TRUE,col.pop="grey",col.sp="black",p.val=0.1,min.ind.signif=3)PvalCalculofp-valueforobjectofclassTstats,ComIndex,ComIndexMultiandlistondexDescriptionCalculofp-valueforobjectofclassTstats,ComIndex,ComIndexMultiandlistondex.Thistestequatestondingthequantileinexpinwhichobswou

ldbefound(underaone-tailedtest).UsagePva
ldbefound(underaone-tailedtest).UsagePval(x,na.rm=TRUE)ArgumentsxAnobjectofclassTstats,ComIndex,ComIndexMultiorlistondex.na.rmAlogicalvalueindicatingwhetherNAvaluesshouldbestrippedbeforethecom-putationproceeds.ValueAlistofp-valueforeachmetrics,traitsandgroupingifneeded(e.g.sites)Author(s)AdrienTaudiereExamplesdata(finch.ind)res.finchTstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=9,print=FALSE)Pval(res.finch)RandCom33RandComToymodeltosimulateinternaland/orexternallteringDescriptionToymodeltosimulateinternaland/orexternallteringUsageRandCom(Ncom=10,Nsp=20,Nind.com=100,sdlog=1.5,min_value_traits=80,max_value_traits=200,cv_intra_sp=1.5,cv_intra_com=1.5,Int_Filter_Strength=50,Ext_Filter_Strength=50,Filter="None")ArgumentsNcomNumberofcommunities(orsites).NspNumberofspeciesattheregionalscale.Nind.comNumberofindividualsbycommunities.sdlogParameterofthelognormaldistributionforspeciesabundancesdistributionwithincommunities.min_value_traitsMinimummeanvaluefortraitsdistributions.max_value_traitsMaximummeanvaluefortraitsdistributions.cv_intra_spCoefcientofvariationforintra-specicdistributions.Themorethevalueishighthelessthereisinternalltering.Usedonlyforthetrait1(normallydis-tributed).cv_intra_comCoefcientofvariationforintra-communitydistributions.Themorethevalueishighthelessthereisexter

nalltering.Usedonlyforthetrait1(norm
nalltering.Usedonlyforthetrait1(normallydistributed)Int_Filter_StrengthStrengthofinternallteringinpercentage.Useinadditiontocv_intra_spbydistributingmeanspeciestraitmoreorlessevenly.Inthemostextremecase(ifInt_Filter_Strength==100),specieshaveequallydistributedmeanvaluesalongthetraitgradient.Ext_Filter_StrengthStrengthofexternallteringinpercentage.Useinadditiontocv_intra_combydistributingmeancommunitiestraitmoreorlessevenly.Inthemostextremecase(ifExt_Filter_Strength==100),communitieshaveequallydistributedmeanvaluesalongthetraitgradient.FilterThetypeofltertosimulate.Either"None","Internal","External"or"Both"34RaoRelDetailsInthisversionofthefunction,thetrait1followsanormaldistributionwherasthetrait2followsauniformdistribution.Value$data$comVectorofsimulatedcommunitiesforeachindividual.$data$spVectorofsimulatedspeciesforeachindividual.$data$trait1Vectorofsimulatedvalueforthetrait1:normallydistributed.$data$trait2Vectorofsimulatedvalueforthetrait2:normallydistributed.$callcallofthefunctionTstatsAuthor(s)CecileAlbertandAdrienTaudiereExamplesresRandCom()RaoRelAlpha,gammaandbeta-componentsfortaxonomic,functionalandphylogeneticdiversityDescriptionTheRaofunctioncomputesalpha,gammaandbeta-componentsfortaxonomic,functionalandphylogeneticdiversitywiththeRaoindex.Thescriptintegratestwofunctions:"Qdecomp",byVilleger

etMouillot(JEcol,2008)modiedbyWilfri
etMouillot(JEcol,2008)modiedbyWilfriedThuiller,and"disc",byS.Pavoine,inthepackageade4.ForaregionalassemblageofClocalcommunitiesgamma=mean(alpha)+beta,where:gammaisthediversityoftheregionalpool,alphaisthediversityofthelocalcommunityandbetaistheturnoverbetweenlocalcommunitiesdiversityisestimatedwiththeRaoquadraticentropyindex(Rao1982)UsageRaoRel(sample,dfunc,dphyl,weight=FALSE,Jost=FALSE,structure=NULL)RaoRel35ArgumentssampleCommunitymatrixofabundance(cxs)ofthesspeciesfortheclocalcommu-nities.dfuncmatrix(sxs)ordistobjectwithpairwisefunctionaltraitdistancesbetweenthesspeciesdphylAsdfunctbutforphylogeneticdistancesweightDeningifthecorrectionbyVilleger&Mouillot(2008) oi:;.1;đ/;&#xj.13;e-];&#xTJ 0;&#x -11;&#x.956;&#x Td ;&#x[000;2745.2007.01351.xisappliedornotJostDeningiftheJostcorrectionisapplied(Jost2007)structureAdataframecontainingthenameofthegrouptowhichsamplesbelongseedeBelloetal,2011formoredetails.DetailsNAareautomaticallyreplacedby0in"sample".Thisfunctionusethefunction"Qdecomp"bySebastienVilleger&DavidMouillot(JEcol,2008)modiedbyWilfriedThuillerandthefunctiondiscoriginallyproposedbySandrinePavoine.ValueTheresultsareorganizedforTaxonomicdiversity($TD),Functionaldiversity($FD)andphyloge-neticaldiversity($PD).Betaandgammadiversitiesarecalculatedforthewholedatasetandforeachpairofsamples("

Pairwise_samples"):$Richness_per_plot(nu
Pairwise_samples"):$Richness_per_plot(numberofspeciespersample)$Relative_abundance(speciesrelativeabundancesperplot)$Pi(speciesregionalrelativeabundance)$Wc(weigthingfactor),$Mean_Alpha(meanaplphadiversity;fortaxonomicdiversitytheSimpsonindexiscalculated)$Alpha(alphadiversityforeachsample;fortaxonomicdiversitytheSimpsonindexiscalculated)$Gamma(gammadiversity;fortaxonomicdiversitytheSimpsonindexiscalculated)$Beta_add(Gamma-Mean_Alpha)$Beta_prop(Beta_add*100/Gamma)$Pairwise_samples$Alpha(meanalphaforeachpairofsamples)$Pairwise_samples$Gamma(gammaforeachpairofsamples)$Pairwise_samples$Beta_add(betaforeachpairofsamplesasGamma-Mean_Alpha)$Pairwise_samples$Beta_prop(betaforeachpairofsamplesasBeta_add*100/Gamma)Author(s)FrancescoDeBelloetal.,2011modiedbyAdrienTaudiere36RaoRelReferencesDeBello,Francesco,SandraLavorel,CecileH.Albert,WilfriedThuiller,KarlGrigulis,JiriDolezal,stepanJanecek,etJanLeps.2011.Quantifyingtherelevanceofintraspecictraitvariabilityforfunctionaldiversity:Intraspecicvariabilityinfunctionaldiversity.MethodsinEcologyandEvo-lution2:163-174.Examplesdata(finch.ind)commt(table(ind.plot.finch,1:length(ind.plot.finch)))comm.sptable(sp.finch,ind.plot.finch)class(comm.sp)"matrix"traits.finch.spapply(apply(traits.finch,2,scale),2,function(x)tapply(x,sp.finch,mean,na.rm=TRUE))mat.dist(as.matrix(dist(traits.

finch.sp))^2)/2res.raoRaoRel(sample=as.m
finch.sp))^2)/2res.raoRaoRel(sample=as.matrix(comm.sp),dfunc=mat.dist,dphyl=NULL,weight=FALSE,Jost=FALSE,structure=NULL)mat.distas.matrix(dist(traits.finch.sp))^2res.raoRaoRel(sample=as.matrix(comm.sp),dfunc=mat.dist,dphyl=NULL,weight=FALSE,Jost=FALSE,structure=NULL)witRaores.rao$FD$Mean_Alpha#overallwithinspeciesvariancebetRaores.rao$FD$Beta_add#betweenspeciesvariancetotRaores.rao$FD$Gamma#thetotalvariancewitRao+betRaototRao#Nowlet"staketheabundancetocalculateRaodiversity.res.rao.wRaoRel(sample=as.matrix(comm.sp),dfunc=mat.dist,dphyl=NULL,weight=TRUE,Jost=FALSE,structure=NULL)witRao.wres.rao.w$FD$Mean_Alpha#overallwithinspeciesvariancebetRao.wres.rao.w$FD$Beta_add#betweenspeciesvariancetotRao.wres.rao.w$FD$Gamma#thetotalvariancewitRao.wbetRao.w#PlottheresultssamplingSubsetData37barplot(cbind(c(witRao.w,betRao.w),c(witRao,betRao)),names.arg=c("abundance","presence"),legend.text=c("withinspecies","betweenspecies"),ylab="Rao",ylim=c(0,10))#Wecandothisanalysisforeachtraitseparately.#Firstweneedtoreplace(orexclude)NAvalues.#Forthisexample,weusethepackagemicetocompletethedata.commt(table(ind.plot.finch,1:length(ind.plot.finch)))library(mice)traits=traits.finchmicemice(traits.finch)traits.finch.micecomplete(mice)traits.finch.mice.spapply(apply(traits.finch.mice,2,scale),2,function(x)tapply(x,sp.finch,mean,na.rm=TRUE))trait.r

ao.wlist()witRao.w.bytraitc()betRao.w.by
ao.wlist()witRao.w.bytraitc()betRao.w.bytraitc()for(tin1:4){trait.rao.w[[t]]RaoRel(sample=as.matrix(comm.sp),dfunc=(dist(traits.finch.mice.sp[,t])^2)/2,dphyl=NULL,weight=TRUE,Jost=FALSE,structure=NULL)witRao.w.bytraitc(witRao.w.bytrait,trait.rao.w[[t]]$FD$Mean_Alpha)betRao.w.bytraitc(betRao.w.bytrait,trait.rao.w[[t]]$FD$Beta_add)}#Plottheresultsbytraits.barplot(t(cbind(witRao.w.bytrait,betRao.w.bytrait)),names.arg=colnames(traits.finch),legend.text=c("withinspecies","betweenspecies"),ylab="Rao",ylim=c(0,1.5))samplingSubsetDataSamplingsubsetofdata.DescriptionSamplingsubsetofdata.38sesUsagesamplingSubsetData(d=NULL,sampUnit=NULL,nperm=9,type="proportion",prop=seq(10,100,by=10),MinSample=1,Size=NULL)ArgumentsdDataframeofdatatosample.Eachlineisanindividual.sampUnitAFactordeningthesamplingunittoimpoverish.Forexampleitcanbethespeciesortheplotattributesofeachindividual.npermNumberofpermutations.typeTypeofsampling.Eitherproportion,count,propBySizeorfactorBySize.Seedetails.propIntegerbetween1and100.Categoricalproportionstosampleinpercentage.MinSampleMinimumnumberofindividualtosamplebysampleunit.Defaultisone.SizeAvectorofvalueforeachindividual(typepropBySizeandfactorBySize)orforeachleveloffactor(factorBySizeonly).Determinetherankofindividual/factorwhenusingthesamplingschemespropBySizeandfactorBySize.DetailsSamplingschemeco

untsampleanumberofindividualswheraspropo
untsampleanumberofindividualswherasproportionsampleaproportionofindividualsbysampleunit.SamplingschemepropBySizesampleineachsamplingunit(sampUnit)aproportionoftheindividualrankedusingtheargumentSize.Consequently,thebigestindividuals(higherSize)willbesamplebeforethesmallerone.factorBySizesampleaproportionofsamplingunit(sampUnit)rankedusingtheargumentSize.Forexampleyoucansampleonlytheindividualsofthe20%ofthemoreaboundantspecies.ValueReturnalistlistofsampledataframe.Therstlevelofthelistdepictsthepermutationandthesecondleveldepictsthedifferentproportion/numberofindividualsampledbyfactor.Author(s)AdrienTaudieresesStandardizedeffectsizeandcondenceintervalforamatrixofstatis-ticsDescriptioncalculationstandardizedeffectsizeandcondenceintervalforamatrixofstatisticsandtherelatednullmodelexpressedasalistorasanarray.Internalfunctionusebyotherfunctionsofthepackage.YoucantransposetheobservedmatrixtorepresenteithertheSESbytraitsorbyplots.ses39Usageses(obs=NULL,nullmodel=NULL,val.quant=c(0.025,0.975))ArgumentsobsObservedmatrixorvectorofvalues.nullmodelEitheralistoranarrayofthree(twoforavectorofobservedvalues)dimensionscorrespondingtothenullmodelpermutations.val.quantNumericvectorsoflength2,givingthequantiletocalculationcondencein-terval.Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%.DetailsWarning:tode

tectautomaticallythecorrespondencebetwee
tectautomaticallythecorrespondencebetweendimensionofobservedmatrixandnullmodellistorarray,observedmatrixneedstohavedifferentnumbersofrowsandcolumns.Inthecaseofsamerowandcolumnnumber,pleaseverifymanuallythecorrespondancebeatweentherowsoftheobservedmatrixandthenullmodelarray.ValueAlistofthreecomponents:$sesObservedvalueofstandardizedeffectsize.$ses.infLowerlimitofthecondenceinterval.$ses.supUpperlimitofthecondenceinterval.Author(s)AdrienTaudiereSeeAlsoplot.listofindex;plotSESvar;ses.listofindexExamplesdata(finch.ind)res.finchTstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=9)ses(res.finch$Tstats$T_IP.IC,res.finch$Tstats$T_IP.IC_nm)40SumBLses.listofindexStandardizedeffectsizeforalistofindex.DescriptionStandardizedeffectsizeandcondenceintervalforalistofindex.Usageses.listofindex(index.list=NULL,val.quant=c(0.025,0.975))Argumentsindex.listAlistofindexobtainusingthefunctionas.listondex.val.quantNumericvectorsoflength2,givingthequantiletocalculationcondencein-terval.Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%.ValueAlistwhicheachcomponentcorrespondtotheresultofthesesfunctionforanindex.Further,eachcomponentisalistofthreecomponents:$sesObservedvalueofstandardizedeffectsize.$ses.infLowerlimitofthecondenceinterval.$ses.supUpperlimitofthecondenceinterval.Author(s)AdrienT

audiereSeeAlsoas.listofindex;sesSumBLSu
audiereSeeAlsoas.listofindex;sesSumBLSumofbranchlengthofaclassicationdendrogram(PetcheyandGaston,2002)DescriptionSumofbranchlengthofaclassicationdendrogram(PetcheyandGaston,2002)SumBL41UsageSumBL(traits,gower.dist=TRUE,method.hclust="average",scale.tr=TRUE,method.dist="euclidian")ArgumentstraitsTraitsmatrix(traitsincolumn)gower.distCalculategowerdistanceusingthefunctiongowdisfrompackageFD.method.hclustDenethemethodforthehclustfunction(defaultis"average"i.e.UPGMA).scale.trDoestraitsneedtobescalebeforemulti-traitsmetriccalculation?Onlyusewhengower.dist=FALSE.Defaultisyes.method.distMethodtocalculatethedistanceincaseofmulti-traitsmetric(functiondist).Onlyusewhengower.dist=FALSE.Defaultiseuclidian.ValueThevalueofthesumofbranchlengthfromaclassicationdendrogramoftraits.Author(s)AdrienTaudiereReferencesPetchey,OL.,andGaston,KJ.2002.Functionaldiversity(FD),speciesrichnessandcommunitycomposition.EcologyLetters5:402-411Examplesdata(finch.ind)SumBL(traits.finch)SumBL(traits.finch,gower.dist=FALSE)42traitex.anovatraitflex.anovaVariancedecompositionforagiventraitusedindecompCTREDescriptionThisfunctiondecomposesvariationoftraitvalueswithinacommunityintothreesources:(i)theintraspecictraitvariability,(ii)thevariabilityduetospeciesturnoverand(iii)theircovariationisalsoseparated.Thisdecompositioniscomputedfo

rthewholevariationinthetraitvaluesand,Th
rthewholevariationinthetraitvaluesand,Theformulaspecied,acrossthecontributionofvariousexplanatoryvariablesconsideredinthemodel.S3methodplotsummarizesgraphicallythedecompositionoftraitvariation,obtainedwiththetraitex.anovafunction.PrintisanotherS3methodforobjectofclasstraitex.Usagetraitflex.anova(formula,specif.avg,const.avg,...)##S3methodforclass'traitflex'plot(x,plot.total=FALSE,use.percentage=TRUE,plot.covar=FALSE,cumul=FALSE,legend.pos=if(plot.total)"topleft"else"topright",plot.res=TRUE,...)##S3methodforclass'traitflex'print(x,...)ArgumentsformulaTheformulaparametermustbeaone-sidedformula,i.e.startingwithatildecharacter.Theresponsevariableisspeciedbythenexttwoarguments,specif.avgandconst.avg.specif.avgVectorwithcommunitytraitcompositionvaluesforasingletrait.Itiscalculatedfromtraitvaluesspecictoeachcommunity(i.e.traitvaluesforindividualspeciesare'specic'toeachplot,orhabitat,wherethespeciesisfound)const.avgVectorwithcommunitytraitcompositionvaluesforasingletrait.Itiscalculatedfromaverage(xed)traitvaluesofindividualspecies(i.e.xedtraitvalueforindividualspeciesusedforallhabitatswherethespeciesisfound)xAnobjectofclasstraitex.plot.totalLogicalvalue;ifTRUEplotnotonlytheindividualcomponentsofvariation,butalsothetotalvariation.Thisisusefulparticularlywhenthedecompositionwasdonewithnon-trivi

alformula(i.e.withexplanatoryvariables)u
alformula(i.e.withexplanatoryvariables)use.percentageLogicalvalue;ifTRUEtheindividualplottedsourcesoftraitvariationareshownaspercentagesofthetotalvariation,on0-100scale.plot.covarLogicalvalue;ifTRUEthecovariancebetweenwithin-speciestraitvariabilityandthevariabilityduetospeciescompositionturnoverisplottedasyetanothercategorywithinthestackedbars.Theplot.covarargumentisentirelyignoredwhenplottingtraitexobjectttedwithaformulawithoutanypredictorvari-ables.Tstats43cumulLogicalvalue;ifTRUEvaluesareshowninacumulativeway.legend.posThisargumentallowsyoutospecifythepositionofgraphlegend.Thusargu-mentisentirelyignoredwhenplottingtraitexobjectcreatedwithaformulawithoutpredictorsplot.resLogicalvalue;ifresume=FALSEplotisnotshownbutthetableofvaluesusedtoprinttheplotisreturn....Optionaladditionalarguments.DetailsTheformulaparametermustbeaone-sidedformula,i.e.startingwithatildecharacter.There-sponsevariableisspeciedbythenexttwoarguments,specif.avgandconst.avg.ValueAnobjectofclasstraitex.Thereareprintandplotmethodsavailableforit.Theobjectcontainsdecompositionofsumofsquaresintointraspecicvariationcomponent,compositionalvariationcomponent,theircovariationandtotalinaSumSqelement.Thisisadataframewithmultiplerowsifpredictorswerespeciedinformulaargument.TheRelSumSqelementcontainsthesametablerelativizedtounitrowtotal

s.Finally,theanova.turnover,anova.total,
s.Finally,theanova.turnover,anova.total,andanova.diffelementscontainthethreeaovobjectsusedtodecomposethevariation.Author(s)JanLepsetal.,2011modiedbyAdrienTaudiereReferencesLeps,Jan,FrancescodeBello,PetrSmilauerandJiriDolezal.2011.Communitytraitresponsetoenvironment:disentanglingspeciesturnovervsintraspecictraitvariabilityeffects.Ecography34(5):856-863.SeeAlsoprint.traitflex;plot.traitflex;decompCTRETstatsComputingobservedT-statistics(TforTraits)andnullexpectations.DescriptionComputingobservedT-statistics(TforTraits)asthreeratiosofvariance,namelyT_IP.IC,T_IC.IRandT_PC.PR.Thisfunctioncanalsoreturnthedistributionofthisthreestatisticsundernullmodels.44TstatsUsageTstats(traits,ind.plot,sp,SE=0,reg.pool=NULL,SE.reg.pool=NULL,nperm=99,printprogress=TRUE,independantTraits=TRUE)sum_Tstats(x,val.quant=c(0.025,0.975),type="all")ses.Tstats(x,val.quant=c(0.025,0.975))##S3methodforclass'Tstats'barplot(height,val.quant=c(0.025,0.975),col.index=c("red","purple","olivedrab3","white"),ylim=NULL,...)##S3methodforclass'Tstats'plot(x,type="normal",col.index=c("red","purple","olivedrab3"),add.conf=TRUE,color.cond=TRUE,val.quant=c(0.025,0.975),...)##S3methodforclass'Tstats'print(x,...)##S3methodforclass'Tstats'summary(object,...)ArgumentstraitsIndividualMatrixoftraitswithtraitsincolumns.Foronetrait,useas.matrix().ind.plotFactorde&#

2;ningthenameoftheplotinwhichtheindividu
2;ningthenameoftheplotinwhichtheindividualis.spFactordeningthespecieswhichtheindividualbelongto.SEAsinglevalueorvectorofstandarderrorsassociatedwitheachtraits.Especiallyallowtohandlemeasurementerrors.Notusedwithpopulationalnullmodel.reg.poolRegionalpooldatafortraits.Ifnotinformed,'traits'isconsideredasthere-gionalpool.Thismatrixneedtobelarger(morerows)thanthematrix"traits".Useonlyfornullmodel2(regional.ind).SE.reg.poolAsinglevalueorvectorofstandarderrorsassociatedwitheachtraitsineachregionalpool.Useonlyifreg.poolisused.Needtohavethesamedimensionasreg.pool.npermNumberofpermutations.IfNULL,onlyobservedvaluesarereturned;printprogressLogicalvalue;printprogressduringthecalculationornot.independantTraitsLogicalvalue(default:TRUE).IfindependantTraitsistrue(default),eachtraitsissampleindependentlyinnullmodels,ifnot,eachlinesofthematrixareran-domized,keepingtherelation(andtrade-off)amongtraits.xAnobjectofclassTstats.heightAnobjectofclassTstats.objectAnobjectofclassTstats.Tstats45val.quantNumericvectorsoflength2,givingthequantiletocalculationcondencein-terval.Bydefaultval.quant=c(0.025,0.975)forabilateraltestwithalpha=5%.ylimNumericvectorsoflength2,givingtheycoordinatesrangecol.indexAvectorofthreecolorcorrespondtothethreeT-statistics.color.condLogicalvalue;Ifcolor.cond=TRUE,colorpointsindicateT-statisticsvaluessignic

ativelydifferentfromthenullmodelandgreyp
ativelydifferentfromthenullmodelandgreypointsarenotdifferentfromnullmodel.typeFortheplotfunction,typeofplot.Possibletype="simple","simple_range","normal","barplot"and"bytraits".Forthesummaryfunction,typeofsummarystatistics.Either"binary","percent","p.value","site"or"all".add.confLogicalvalue;Addcondenceintervalsornot....Anyadditionalargumentsarepassedtotheplotfunctioncreatingthecoreoftheplotandcanbeusedtoadjustthelookofresultinggraph.Seeplot.listofindexformorearguments.DetailsS3methodplot:-Normaltypeplotmeans,standarddeviations,rangesandcondenceintervalsofT-statistics.-Simple_rangetypeplotmeans,standarddeviationsandrangeofT-statistics-SimpletypeplotT-statisticsforeachsiteandtraitsandthemeancondenceintervalsbytraits-Barplottypeplotmeans,standarddeviationsandcondenceintervalsofT-statisticsinabarplotfashion-Bysitestypeploteachmetricsforeachsites-BytraitstypeploteachmetricsforeachtraitsS3methodprint:printthestructureiftheobjectofclassTstatsS3methodsummary:printthesummarystatisticsofthethreeT-statisticsMethodsummarysum_Tstats:-BinarytypeonlytestifaT-statisticsissignicativelydifferentfromthenullexpectationforeachtrait.-PercenttypedeterminethepercentageofsitesweretheT-statisticsissignicativelydifferentfromthenullexpectationforeachtrait.Asterixshowsglobalsignicanceofthetest.-P-valuetypedeterminethep-

value(twounilateraltests)oftheT-statisti
value(twounilateraltests)oftheT-statisticsforeachtraitandsites.-SitetypeallowstoknowinwhichsitesT-statisticsdeviatefromthenullexpectation.-Alltypedoalltheprecedenttypeofsummary.ValueAlistofstatistics:Tstats$T_IP.ICObservedratiobetweenvarianceofindividualsinpopulationsandindividualsincommunities46TstatsTstats$T_IC.IRObservedratiobetweenvarianceofindividualsincommunitiesandindividualsintheregionTstats$T_PC.PRObservedratiobetweenvarianceofpopulationsincommunitiesandpopulationsintheregion$Tstats$T_IP.IC_nmIfnpermisnumeric;ResultofsimulationforT_IP.IC$Tstats$T_IC.IR_nmIfnpermisnumeric;ResultofsimulationforT_IC.IR$Tstats$T_PC.PR_nmIfnpermisnumeric;ResultofsimulationforT_PC.PR$variances$var_IPvarianceofindividualswithinpopulations$variances$var_PCvarianceofpopulationswithincommunities$variances$var_CRvarianceofcommunitieswithintheregion$variances$var_ICvarianceofindividualswithincommunities$variances$var_PRvarianceofpopulationswithintheregion$variances$var_IRvarianceofindividualswithintheregion$variances$var_IP_nm1varianceofindividualswithinpopulationsinnullmodel1$variances$var_PC_nm2spvarianceofpopulationswithincommunitiesinnullmodel2sp$variances$var_IC_nm1varianceofcommunitieswithintheregioninnullmodel1$variances$var_IC_nm2varianceofindividualswithincommunitiesinnullmodel2$variances$var_PR_nm2spvarianceofpopulationswithinth

eregioninnullmodel2sp$variances$var_IR_n
eregioninnullmodel2sp$variances$var_IR_nm2varianceofindividualswithintheregioninnullmodel2$traitstraitsdata$ind.plotnameoftheplotinwhichtheindividualis$spgroups(e.g.species)whichtheindividualbelongto$callcallofthefunctionTstatsAuthor(s)AdrienTaudiereandCyrilleViolleTstats47ReferencesViolle,Cyrille,BrianJ.Enquist,BrianJ.McGill,LinJiang,CecileH.Albert,CatherineHulshof,VincentJung,etJulieMessier.2012.Thereturnofthevariance:intraspecicvariabilityincom-munityecology.TrendsinEcology&Evolution27(4):244-252.doi:10.1016/j.tree.2011.11.014.SeeAlsoComIndex;ComIndexMulti;plotCorTstats;plotSESvar;plot.listofindexExamplesdata(finch.ind)res.finchTstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,nperm=9,print=FALSE)res.finch#TstatsclassisassociatedtoS3methodsplot,barplotandsummaryplot(res.finch)plot(res.finch,type="simple")plot(res.finch,type="simple_range")plot(res.finch,type="barplot")plot(res.finch,type="bysites")plot(res.finch,type="bytraits")sum_Tstats(res.finch,type="binary")sum_Tstats(res.finch,type="site")sum_Tstats(res.finch,type="p.value")barplot(res.finch)####Anotherwaytosee"sesvalues"ofT-statistics#Customtheme(fromrasterVispackage)require(rasterVis)my.themeBuRdTheme()#Customizethecolorkeymy.ckeylist(col=my.theme$regions$col)levelplot(t(ses(res.finch$Tstats$T_IP.IC,res.finch$Tstats$T_IP.IC_nm)$ses),colorkey=my.cke

y,par.settings=my.theme,border="black")#
y,par.settings=my.theme,border="black")####Useadifferentregionalpoolthanthebindingofstudiedcommunities#createarandomregionalpoolfortheexample48Tstatsreg.prbind(traits.finch,traits.finch[sample(1:2000,300),])res.finch2Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,reg.pool=reg.p,nperm=9,print=FALSE)plot(as.listofindex(list(res.finch,res.finch2)))####Useadifferentregionalpoolforeachcommunities#createarandomregionalpoolforeachcommunitiesfortheexamplelist.reg.plist(traits.finch[sample(1:290,200),],traits.finch[sample(100:1200,300),],traits.finch[sample(100:1500,1000),],traits.finch[sample(300:800,300),],traits.finch[sample(1000:2000,500),],traits.finch[sample(100:900,700),])#Warning:theregionalpoolneedtobelargerthantheobservedcommunitiestable(ind.plot.finch)#Forexemple,thethirdcommunityneedaregionalpoolofmorethan981individualsres.finch3Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,reg.pool=list.reg.p,nperm=9,print=FALSE)plot(as.listofindex(list(res.finch,res.finch2,res.finch3)))####Usethestandarderrorsofmeasureintheanalysis(argumentSE)res.finch.SE0Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,SE=0,print=FALSE)res.finch.SE5Tstats(traits.finch,ind.plot=ind.plot.finch,sp=sp.finch,SE=5,print=FALSE)plot(as.listofindex(list(res.finch.SE0,res.finch.SE5)))Index.Random.seed(finch.ind),15AbToInd,2as.lis

tofindex,3,22,26,40Auxiliaryfunctions,4b
tofindex,3,22,26,40Auxiliaryfunctions,4barPartvar,20barPartvar(partvar),19barplot.decompCTRE,14barplot.decompCTRE(decompCTRE),13barplot.Tstats(Tstats),43ComIndex,5,12,16,26,47ComIndexMulti,8,9,16,26,47CVNND(Neigbourhooddistancemetrics),18decompCTRE,13,43finch.ind,15Fred,15funky.col(Auxiliaryfunctions),4ind.plot.finch(finch.ind),15IndexByGroups,16MinMaxMST,17MinNND(Neigbourhooddistancemetrics),18MND(Neigbourhooddistancemetrics),18MNND(Neigbourhooddistancemetrics),18Neigbourhooddistancemetrics,18partvar,19piePartvar,20piePartvar(partvar),19plot.ComIndex(ComIndex),5plot.ComIndexMulti(ComIndexMulti),9plot.listofindex,3,7,8,11,12,21,26,28,39,45,47plot.traitflex,43plot.traitflex(traitflex.anova),42plot.Tstats,22,24plot.Tstats(Tstats),43plotCorTstats,23,47plotDistri,24,29,31plotRandtest,26plotSESvar,24,27,39,47plotSpPop,25,28plotSpVar,30print.ComIndex(ComIndex),5print.ComIndexMulti(ComIndexMulti),9print.traitflex,43print.traitflex(traitflex.anova),42print.Tstats(Tstats),43Pval,32RandCom,33RaoRel,34samplingSubsetData,37SDND(Neigbourhooddistancemetrics),18SDNND(Neigbourhooddistancemetrics),18ses,8,12,28,38,40ses.listofindex,3,22,39,40ses.Tstats(Tstats),43sp.finch(finch.ind),15sum_Tstats(Tstats),43SumBL,40summary.ComIndex(ComIndex),5summary.ComIndexMulti(ComIndexMulti),9summary.Tstats(Tstats),43traitflex.anova,14,42traits.finch(f