R语言vegan包使用教程(9)
时间:2025-07-13
时间:2025-07-13
R语言中的外在软件包“Vegan”是专门用于群落生态学分析的工具。Vegan能够提供所有基本的排序方法,同时具有生成精美排序图的功能,版本更新很快。我们认为Vegan包完全可以取代CANOCO,成为今后排序分析的首选统计工具。
2ORDINATION:BASICMETHODthistutorialIshowhowtoruntheseanalyseswithveganfunctionsrdaandccawhichactuallyweredesignedforconstrainedanalysis.
Principalcomponentsanalysiscanberunas:
>vare.pca<-rda(varespec)>vare.pca
Call:rda(X=varespec)InertiaRank
Total1826Unconstrained182623Inertiaisvariance
Eigenvaluesforunconstrainedaxes:PC1PC2PC3PC4PC5PC6PC7PC8983.0464.3132.373.948.437.025.719.7
(Showedonly8ofall23unconstrainedeigenvalues)>plot(vare.pca)
Theoutputtellsthatthetotalinertiais1826,andtheinertiaisvari-ance.Thesumofall23(rank)eigenvalueswouldbeequaltothetotalinertia.Inotherwords,thesolutiondecomposesthetotalvarianceintolinearcomponents.Wecaneasilyseethatthevarianceequalsinertia:
>sum(apply(varespec,2,var))[1]1826
Functionapplyappliesfunctionvarorvariancetodimension2orcolumns(species),andthensumtakesthesumofthesevalues.Inertiaisthesumofallspeciesvariances.Theeigenvaluessumuptototalinertia.Inotherwords,theyeach“explain”acertainproportionoftotalvariance.The rstaxis“explains”983/1826=53.8%oftotalvariance.
Thestandardordinationplotcommandusespointsorlabelsforspeciesandsites.Somepeopleprefertousebiplotarrowsforspeciesinpcaandpossiblyalsoforsites.Thereisaspecialbiplotfunctionforthispurpose:
>biplot(vare.pca,scaling=-1)
Forthisgraphwespeci edscaling=-1.Theresultsarescaledonlywhentheyareaccessed,andwecan exiblychangethescalinginplot,biplotandothercommands.Thenegativevaluesmeanthatspeciesscoresaredividedbythespeciesstandarddeviationssothatabundantandscarcespecieswillbeapproximatelyasfarawayfromtheorigin.
Thespeciesordinationlookssomewhatunsatisfactory:onlyreindeerlichens(Cladina)andPleuroziumschreberiarevisible,andallotherspeciesarecrowdedattheorigin.Thishappensbecauseinertiawasvari-ance,andonlyabundantspecieswithhighvariancesareworthexplaining(butwecouldhidethisinplotbysettingnegativescaling).Standard-izingallspeciestounitvariance,orusingcorrelationcoe cientsinsteadofcovarianceswillgiveamorebalancedordination:
>vare.pca<-rda(varespec,scale=TRUE)>vare.pca
9
2.4Eigenvectormethods
6
57
6
4
Cla.ran
Cla.arb
18
132
4
3
2
14
CP0
Cet.nivPol.pilCla.spBar.lycPin.sylCet.eriIch.eriDic.polCla.fimCla.criCla.cerCla.botDic.fusDic.spLed.palCla.corDes.fleCla.chlPoh.nutPol.junCet.islPti.cilEmp.nigVac.myrHyl.spl21Vac.vit2
152212
2
25
24
10Cla.ste
9
4 Ple.sch27
628
4 20246810
PC1
Cla.arbCla.ran
4
Ich.eri
75
Ste.sp62
Vac.uli
Cla.amaPol.pilCla.cocCla.gra18Cal.vul
13Dip.mon2
CCet.eriCet.nivP14Cla.fim430Cla.def20Cla.cer232121522Dic.fus25Pol.jun24
Cla.spPin.syl12Dic.spCet.islCla.chlCla.phy
Led.palCla.ste10
Emp.nig9
2
27Des.fleVac.vitPoh.nut
28
Vac.myr
Hyl.spl
4
Ple.sch
4 20
246
PC1
…… 此处隐藏:692字,全部文档内容请下载后查看。喜欢就下载吧 ……