# NOT RUN {
# examples with a dummy dataset
ex1 <- gowdis(dummy$trait)
ex1
ex2 <- functcomp(dummy$trait, dummy$abun)
ex2
ex3 <- dbFD(dummy$trait, dummy$abun)
ex3
# examples with real data from New Zealand short-tussock grasslands
# these examples may take a few seconds to a few minutes each to run
ex4 <- gowdis(tussock$trait)
ex5 <- functcomp(tussock$trait, tussock$abun)
# 'lingoes' correction used because 'sqrt' does not work in that case
ex6 <- dbFD(tussock$trait, tussock$abun, corr = "lingoes")
# }
# NOT RUN {
# ward clustering to compute FGR, cailliez correction
ex7 <- dbFD(tussock$trait, tussock$abun, corr = "cailliez",
calc.FGR = TRUE, clust.type = "ward")
# choose 'g' for number of groups
# 6 groups seems to make good ecological sense
ex7
# however, calinksi criterion in 'kmeans' suggests
# that 6 groups may not be optimal
ex8 <- dbFD(tussock$trait, tussock$abun, corr = "cailliez",
calc.FGR = TRUE, clust.type = "kmeans", km.sup.gr = 10)
# }
Run the code above in your browser using DataLab