一般植物功能特征被劃分為3類:一是植物形態(tài)特征, 包括生長型阔涉、生活型褒傅、植株高度等捧存;二是植物生殖特征,包括傳粉方式粪躬、擴(kuò)散方式担败、種子重量等;三是植物生理特征, 如植物固氮能力等[30].
為研究中包括的每個(gè)物種創(chuàng)建一個(gè)定性和/或定量性狀的矩陣镰官;使用R中的FD包來計(jì)算你選擇的性狀的種間Gower距離提前。Gower距離矩陣可用于繪制樹狀圖,描述物種間的相似性/不相似性泳唠,然后你可以使用R中的FD或BAT或其他軟件包狈网,以類似于計(jì)算系統(tǒng)發(fā)育多樣性(PD)的方式,總結(jié)連接每個(gè)物種庫中的物種的分支長度笨腥。 參考:https://www.researchgate.net/post/Can_anyone_help_with_measuring_functional_diversity
FD computes different multidimensional FD indices. Tocompute FD indices, a species-by-trait(s) matrix is required (or at least aspecies-by-species distance matrix). gowdis computes the Gower dissimilarityfrom different trait types (continuous, ordinal, nominal, or binary), andtolerates NAs. It can treat ordinal variables as described by Podani (1999),and can handle asymetric binary variables and variable weights. gowdis iscalled bydbFD, the main function of FD.】
dbFD uses principal coordinates analysis (PCoA) toreturn PCoA axes, which are then used as ‘traits’to compute FD. dbFD computesseveral multidimensional FD indices, including the three indices of Villéger etal. (2008): functional richness (FRic), functional evenness (FEve), andfunctional divergence (FDiv). It also computesfunctional dispersion (FDis) (Laliberté and Legendre 2010), Rao’s quadraticentropy (Q) (Botta-Dukát 2005), a posteriori functional group richness (FGR),and the community-level weighted means of trait values (CWM), an index offunctional composition. Some of these indices can be weighted by speciesabundances. dbFD includes several options for flexibility.
Package FD:computes different multidimensional functional diversity (FD) indices
基本命令:?dbFD(x, a, w, w.abun = TRUE, stand.x = TRUE,..)
x: 功能特征的矩陣或數(shù)據(jù)框架
a: 包括出現(xiàn)在x中的物種豐富度矩陣拓哺。The number of species (columns) in a must?match the number of species (rows) in x. In addition, thespecies labels in a and?x must be identical and in the same order. (x和a兩個(gè)數(shù)據(jù)集的物種數(shù)目一致和順序相同)
1. 數(shù)據(jù)準(zhǔn)備:
建立兩個(gè)數(shù)據(jù)dataframe, 保持兩個(gè)數(shù)據(jù)集中的物種名稱順序保持一致:
FD包官方測試數(shù)據(jù):藍(lán)奏云: https://wwe.lanzoui.com/iG2lNqyrt5g
情況1:手動(dòng)錄入的數(shù)據(jù)脖母,或者數(shù)據(jù)量少的數(shù)據(jù)可手動(dòng)調(diào)節(jié)士鸥;
情況2:物種較多,兩個(gè)數(shù)據(jù)集包含較多的物種名稱不一致情況谆级;
解決辦法:使用excel烤礁,若X和a中的物種不完全相符,以物種較少的數(shù)據(jù)物種數(shù)目為準(zhǔn)肥照,刪減x中的數(shù)據(jù)以對應(yīng)a脚仔。利用數(shù)據(jù)透視表功能建立數(shù)據(jù)矩陣;注意:a中物種名稱若出現(xiàn)空格建峭,將不能成功讀取玻侥,會出現(xiàn)格式變化,建議標(biāo)準(zhǔn)物種名稱為“Abies_chensiensis”(加短橫線)亿蒸。
2. FD包計(jì)算
2.1 加載包
library(“FD”)? ?#加載FD包
2.2 加載數(shù)據(jù)
traits <- read.csv("D:/xxx.csv", row.names=1)? ?#x姑食,加載數(shù)據(jù)
species <- read.csv("D:/xxx.csv", header=T,row.names=1)? ?#a,加載數(shù)據(jù)
2.3 數(shù)據(jù)檢查
rownames(traits)? #查看導(dǎo)入數(shù)據(jù)的行列名稱茅坛,是否有不一致情況
colnames(traits)??#查看導(dǎo)入數(shù)據(jù)的行列名稱音半,是否有不一致情況
rownames(species)??#查看導(dǎo)入數(shù)據(jù)的行列名稱,是否有不一致情況
colnames(species)??#查看導(dǎo)入數(shù)據(jù)的行列名稱贡蓖,是否有不一致情況
2.4 計(jì)算FD
results?= dbFD(traits, species, corr="lingoes")? ? #dbFD計(jì)算FD值
2.4.1 常見FD計(jì)算步驟報(bào)錯(cuò)
報(bào)錯(cuò)信息:
#Error in dbFD(traits, species) :? At least onespecies does not occur in any community (zero total abundance across allcommunities).
解決辦法:x和a兩個(gè)數(shù)據(jù)集物種不一致眠屎,存在無功能性狀的空白物種數(shù)據(jù),需要?jiǎng)h除樣方中不存在的物種
報(bào)錯(cuò)信息:
#Error in dbFD(traits, species) :
? Species xspecies distance matrix was still is not Euclidean after 'sqrt' correction. Useanother correction method.
?解決辦法:a =dbFD(traits, species, corr="lingoes")
2.5 數(shù)據(jù)導(dǎo)出
write.csv(results,file = "D:/ xxx-FD-results.csv")? #數(shù)據(jù)導(dǎo)出肆饶,結(jié)果導(dǎo)出為csv格式數(shù)據(jù)
## FD一般是FR改衩,F(xiàn)E,F(xiàn)D三個(gè)層面驯镊,F(xiàn)R指功能多樣性豐富度葫督,F(xiàn)E值功能多樣性均勻度,F(xiàn)D值功能多樣性離散度阿宅。