## Mixed-variables coefficient of distance

### Description

The mixed-variables coefficient of distance generalizes Gower's general coefficient of distance to allow the treatment of various statistical types of variables when calculating distances. This is especially important when measuring functional diversity. Indeed, most of the indices that measure functional diversity depend on variables (traits) that have various statistical types (e.g. circular, fuzzy, ordinal) and that go through a matrix of distances among species.

### Usage

```dist.ktab(x, type, option = c("scaledBYrange", "scaledBYsd", "noscale"), scann = FALSE, tol = 1e-8)
ldist.ktab(x, type, option = c("scaledBYrange", "scaledBYsd", "noscale"), scann = FALSE, tol = 1e-8)
kdist.cor(x, type, option = c("scaledBYrange", "scaledBYsd", "noscale"), scann = FALSE, tol = 1e-8, squared = TRUE)
prep.fuzzy(df, col.blocks, row.w = rep(1, nrow(df)), labels = paste("F", 1:length(col.blocks), sep = ""))
prep.binary(df, col.blocks, labels = paste("B", 1:length(col.blocks), sep = ""))
prep.circular(df, rangemin = apply(df, 2, min, na.rm = TRUE), rangemax = apply(df, 2, max, na.rm = TRUE))
```

### Arguments

 `x` Object of class `ktab` (see details) `type` Vector that provide the type of each table in x. The possible types are "Q" (quantitative), "O" (ordinal), "N" (nominal), "D" (dichotomous), "F" (fuzzy, or expressed as a proportion), "B" (multichoice nominal variables, coded by binary columns), "C" (circular). Values in type must be in the same order as in x. `option` A string that can have three values: either "scaledBYrange" if the quantitative variables must be scaled by their range, or "scaledBYsd" if they must be scaled by their standard deviation, or "noscale" if they should not be scaled. This last option can be useful if the the values have already been normalized by the known range of the whole population instead of the observed range measured on the sample. If x contains data from various types, then the option "scaledBYsd" is not suitable (a warning will appear if the option selected with that condition). `scann` A logical. If TRUE, then the user will have to choose among several possible functions of distances for the quantitative, ordinal, fuzzy and binary variables. `tol` A tolerance threshold: a value less than tol is considered as null. `squared` A logical, if TRUE, the squared distances are considered. `df` Objet of class data.frame `col.blocks` A vector that contains the number of levels per variable (in the same order as in `df`) `row.w` A vector of row weigths `labels` the names of the traits `rangemin` A numeric corresponding to the smallest level where the loop starts `rangemax` A numeric corresponding to the highest level where the loop closes

### Value

The functions provide the following results:
 `dist.ktab` returns an object of class `dist`; `ldist.ktab` returns a list of objects of class `dist` that correspond to the distances between species calculated per trait; `kdist.cor` returns a list of three objects: "paircov" provides the covariance between traits in terms of (squared) distances between species; "paircor" provides the correlations between traits in terms of (squared) distances between species; "glocor" provides the correlations between the (squared) distances obtained for each trait and the global (squared) distances obtained by mixing all the traits (= contributions of traits to the global distances); `prep.binary and prep.fuzzy` returns a data frame with the following attributes: col.blocks specifies the number of columns per fuzzy variable; col.num specifies which variable each column belongs to; `prep.circular` returns a data frame with the following attributes: max specifies the number of levels in each circular variable.

### Author(s)

Sandrine Pavoine pavoine@mnhn.fr

### References

Pavoine S., Vallet, J., Dufour, A.-B., Gachet, S. and Daniel, H. (2009) On the challenge of treating various types of variables: Application for improving the measurement of functional diversity. Oikos, 118, 391–402.

`daisy` in the `cluster` package in the case of ratio-scale (quantitative) and nominal variables; and `woangers` for an application.

### Examples

```# With fuzzy variables
data(bsetal97)

w <- prep.fuzzy(bsetal97\$biol, bsetal97\$biol.blo)
w[1:6, 1:10]
ktab1 <- ktab.list.df(list(w))
dis <- dist.ktab(ktab1, type = "F")
as.matrix(dis)[1:5, 1:5]

## Not run:
# With ratio-scale and multichoice variables
data(ecomor)

wM <- log(ecomor\$morpho + 1) # Quantitative variables
wD <- ecomor\$diet
# wD is a data frame containing a multichoice nominal variable
# (diet habit), with 8 modalities (Granivorous, etc)
# We must prepare it by prep.binary
wD <- prep.binary(wD, col.blocks = 8, label = "diet")
wF <- ecomor\$forsub
# wF is also a data frame containing a multichoice nominal variable
# (foraging substrat), with 6 modalities (Foliage, etc)
# We must prepare it by prep.binary
wF <- prep.binary(wF, col.blocks = 6, label = "foraging")
# Another possibility is to combine the two last data frames wD and wF as
# they contain the same type of variables
wB <- cbind.data.frame(ecomor\$diet, ecomor\$forsub)
wB <- prep.binary(wB, col.blocks = c(8, 6), label = c("diet", "foraging"))
# The results given by the two alternatives are identical
ktab2 <- ktab.list.df(list(wM, wD, wF))
disecomor <- dist.ktab(ktab2, type= c("Q", "B", "B"))
as.matrix(disecomor)[1:5, 1:5]
contrib2 <- kdist.cor(ktab2, type= c("Q", "B", "B"))
contrib2

ktab3 <- ktab.list.df(list(wM, wB))
disecomor2 <- dist.ktab(ktab3, type= c("Q", "B"))
as.matrix(disecomor2)[1:5, 1:5]
contrib3 <- kdist.cor(ktab3, type= c("Q", "B"))
contrib3

# With a range of variables
data(woangers)

traits <- woangers\$traits
# Nominal variables 'li', 'pr', 'lp' and 'le'
# (see table 1 in the main text for the codes of the variables)
tabN <- traits[,c(1:2, 7, 8)]
# Circular variable 'fo'
tabC <- traits[3]
tabCp <- prep.circular(tabC, 1, 12)
# The levels of the variable lie between 1 (January) and 12 (December).
# Ordinal variables 'he', 'ae' and 'un'
tabO <- traits[, 4:6]
# Fuzzy variables 'mp', 'pe' and 'di'
tabF <- traits[, 9:19]
tabFp <- prep.fuzzy(tabF, c(3, 3, 5), labels = c("mp", "pe", "di"))
# 'mp' has 3 levels, 'pe' has 3 levels and 'di' has 5 levels.
# Quantitative variables 'lo' and 'lf'
tabQ <- traits[, 20:21]
ktab1 <- ktab.list.df(list(tabN, tabCp, tabO, tabFp, tabQ))
distrait <- dist.ktab(ktab1, c("N", "C", "O", "F", "Q"))
is.euclid(distrait)
contrib <- kdist.cor(ktab1, type = c("N", "C", "O", "F", "Q"))
contrib
dotchart(sort(contrib\$glocor), labels = rownames(contrib\$glocor)[order(contrib\$glocor[, 1])])

## End(Not run)
```

### Worked out examples

```
> ### Name: dist.ktab
> ### Title: Mixed-variables coefficient of distance
> ### Aliases: dist.ktab prep.binary prep.circular prep.fuzzy ldist.ktab
> ###   kdist.cor
> ### Keywords: multivariate
>
> ### ** Examples
>
> # With fuzzy variables
> data(bsetal97)
>
> w <- prep.fuzzy(bsetal97\$biol, bsetal97\$biol.blo)
> w[1:6, 1:10]
size.1 size.2 size.3 size.4 size.5 size.6 size.7 egglen.1 egglen.2 egglen.3
E1      0      0      0      1      0   0.00   0.00        0        0        0
E2     NA     NA     NA     NA     NA     NA     NA        0        0        0
E3      0      1      0      0      0   0.00   0.00        0        0        0
E4      0      0      0      1      0   0.00   0.00        0        0        0
E5      0      0      0      0      0   0.25   0.75        0        0        0
E6      0      0      0      0      0   0.50   0.50        0        0        0
> ktab1 <- ktab.list.df(list(w))
> dis <- dist.ktab(ktab1, type = "F")
> as.matrix(dis)[1:5, 1:5]
E1        E2        E3        E4        E5
E1 0.0000000 0.6947589 0.5947593 0.4008332 0.6487069
E2 0.6947589 0.0000000 0.6401753 0.6689944 0.5623047
E3 0.5947593 0.6401753 0.0000000 0.7107262 0.6289859
E4 0.4008332 0.6689944 0.7107262 0.0000000 0.5244575
E5 0.6487069 0.5623047 0.6289859 0.5244575 0.0000000
>
>
> # With ratio-scale and multichoice variables
> data(ecomor)
>
> wM <- log(ecomor\$morpho + 1) # Quantitative variables
> wD <- ecomor\$diet
> # wD is a data frame containing a multichoice nominal variable
> # (diet habit), with 8 modalities (Granivorous, etc)
> # We must prepare it by prep.binary
Gr Fr Ne Fo In Ca Li Ch
E033  0  0  1  0  0  0  0  0
E034  0  0  1  0  0  0  0  0
E035  0  0  1  0  0  0  0  0
E070  0  0  1  0  1  0  0  0
E071  0  0  1  0  0  0  0  0
E001  1  0  0  0  0  0  0  0
> wD <- prep.binary(wD, col.blocks = 8, label = "diet")
> wF <- ecomor\$forsub
> # wF is also a data frame containing a multichoice nominal variable
> # (foraging substrat), with 6 modalities (Foliage, etc)
> # We must prepare it by prep.binary
foliage ground twig bush trunk aerial
E033       1      0    0    1     0      0
E034       1      0    0    1     0      0
E035       1      0    0    1     0      0
E070       0      0    0    0     0      1
E071       1      0    0    1     0      0
E001       1      1    0    0     0      0
> wF <- prep.binary(wF, col.blocks = 6, label = "foraging")
> # Another possibility is to combine the two last data frames wD and wF as
> # they contain the same type of variables
> wB <- cbind.data.frame(ecomor\$diet, ecomor\$forsub)
Gr Fr Ne Fo In Ca Li Ch foliage ground twig bush trunk aerial
E033  0  0  1  0  0  0  0  0       1      0    0    1     0      0
E034  0  0  1  0  0  0  0  0       1      0    0    1     0      0
E035  0  0  1  0  0  0  0  0       1      0    0    1     0      0
E070  0  0  1  0  1  0  0  0       0      0    0    0     0      1
E071  0  0  1  0  0  0  0  0       1      0    0    1     0      0
E001  1  0  0  0  0  0  0  0       1      1    0    0     0      0
> wB <- prep.binary(wB, col.blocks = c(8, 6), label = c("diet", "foraging"))
> # The results given by the two alternatives are identical
> ktab2 <- ktab.list.df(list(wM, wD, wF))
> disecomor <- dist.ktab(ktab2, type= c("Q", "B", "B"))
> as.matrix(disecomor)[1:5, 1:5]
E033       E034       E035      E070      E071
E033 0.00000000 0.05868490 0.03142782 0.5373658 0.1343612
E034 0.05868490 0.00000000 0.04992167 0.5040856 0.0894764
E035 0.03142782 0.04992167 0.00000000 0.5339737 0.1293197
E070 0.53736584 0.50408559 0.53397371 0.0000000 0.4639627
E071 0.13436115 0.08947639 0.12931967 0.4639627 0.0000000
> contrib2 <- kdist.cor(ktab2, type= c("Q", "B", "B"))
> contrib2
\$paircov
wingl        taill        culml        bilh       billw
wingl    0.017272214  0.008120658 0.0074034522 0.008644054 0.010216312
taill    0.008120658  0.008019829 0.0029362834 0.004825447 0.006001567
culml    0.007403452  0.002936283 0.0152586051 0.003846321 0.005689463
bilh     0.008644054  0.004825447 0.0038463210 0.020394141 0.011685619
billw    0.010216312  0.006001567 0.0056894633 0.011685619 0.014267825
tarsl    0.003327990  0.004596348 0.0008074234 0.004546117 0.005226895
midtl    0.009076022  0.006024241 0.0039104409 0.007724854 0.008027585
weig     0.013795777  0.006675840 0.0064509745 0.009313112 0.009517696
diet     0.007335437  0.005950454 0.0022831689 0.009772576 0.006060185
foraging 0.000867154 -0.001487039 0.0021287124 0.003741598 0.001734456
tarsl       midtl        weig        diet     foraging
wingl    0.0033279899 0.009076022 0.013795777 0.007335437  0.000867154
taill    0.0045963476 0.006024241 0.006675840 0.005950454 -0.001487039
culml    0.0008074234 0.003910441 0.006450975 0.002283169  0.002128712
bilh     0.0045461170 0.007724854 0.009313112 0.009772576  0.003741598
billw    0.0052268952 0.008027585 0.009517696 0.006060185  0.001734456
tarsl    0.0121404053 0.008768413 0.005213359 0.012059499  0.001091060
midtl    0.0087684127 0.012698649 0.011907271 0.010078733  0.002671984
weig     0.0052133590 0.011907271 0.016743058 0.010860104  0.002614463
diet     0.0120594992 0.010078733 0.010860104 0.114866122  0.004669637
foraging 0.0010910596 0.002671984 0.002614463 0.004669637  0.114531953

\$paircor
wingl       taill      culml       bilh      billw      tarsl
wingl    1.0000000  0.68997709 0.45603991 0.46056482 0.65079056 0.22982189
taill    0.6899771  1.00000000 0.26543488 0.37731346 0.56105209 0.46581526
culml    0.4560399  0.26543488 1.00000000 0.21803961 0.38559820 0.05932358
bilh     0.4605648  0.37731346 0.21803961 1.00000000 0.68504660 0.28891581
billw    0.6507906  0.56105209 0.38559820 0.68504660 1.00000000 0.39714428
tarsl    0.2298219  0.46581526 0.05932358 0.28891581 0.39714428 1.00000000
midtl    0.6128339  0.59695417 0.28092446 0.48001941 0.59638579 0.70619661
weig     0.8112501  0.57611071 0.40359941 0.50399324 0.61579412 0.36566522
diet     0.1646857  0.19605215 0.05453617 0.20191119 0.14969628 0.32293618
foraging 0.0194966 -0.04906552 0.05092092 0.07741784 0.04290629 0.02925961
midtl       weig       diet    foraging
wingl    0.61283391 0.81125012 0.16468573  0.01949660
taill    0.59695417 0.57611071 0.19605215 -0.04906552
culml    0.28092446 0.40359941 0.05453617  0.05092092
bilh     0.48001941 0.50399324 0.20191119  0.07741784
billw    0.59638579 0.61579412 0.14969628  0.04290629
tarsl    0.70619661 0.36566522 0.32293618  0.02925961
midtl    1.00000000 0.81661265 0.26389503  0.07006349
weig     0.81661265 1.00000000 0.24763989  0.05970377
diet     0.26389503 0.24763989 1.00000000  0.04071213
foraging 0.07006349 0.05970377 0.04071213  1.00000000

\$glocor
global distance
wingl          0.6903892
taill          0.6082382
culml          0.4328616
bilh           0.6237976
billw          0.6922475
tarsl          0.5528580
midtl          0.7567941
weig           0.7585159
diet           0.5721922
foraging       0.4129843

>
> ktab3 <- ktab.list.df(list(wM, wB))
> disecomor2 <- dist.ktab(ktab3, type= c("Q", "B"))
> as.matrix(disecomor2)[1:5, 1:5]
E033       E034       E035      E070      E071
E033 0.00000000 0.05868490 0.03142782 0.5373658 0.1343612
E034 0.05868490 0.00000000 0.04992167 0.5040856 0.0894764
E035 0.03142782 0.04992167 0.00000000 0.5339737 0.1293197
E070 0.53736584 0.50408559 0.53397371 0.0000000 0.4639627
E071 0.13436115 0.08947639 0.12931967 0.4639627 0.0000000
> contrib3 <- kdist.cor(ktab3, type= c("Q", "B"))
> contrib3
\$paircov
wingl        taill        culml        bilh       billw
wingl    0.017272214  0.008120658 0.0074034522 0.008644054 0.010216312
taill    0.008120658  0.008019829 0.0029362834 0.004825447 0.006001567
culml    0.007403452  0.002936283 0.0152586051 0.003846321 0.005689463
bilh     0.008644054  0.004825447 0.0038463210 0.020394141 0.011685619
billw    0.010216312  0.006001567 0.0056894633 0.011685619 0.014267825
tarsl    0.003327990  0.004596348 0.0008074234 0.004546117 0.005226895
midtl    0.009076022  0.006024241 0.0039104409 0.007724854 0.008027585
weig     0.013795777  0.006675840 0.0064509745 0.009313112 0.009517696
diet     0.007335437  0.005950454 0.0022831689 0.009772576 0.006060185
foraging 0.000867154 -0.001487039 0.0021287124 0.003741598 0.001734456
tarsl       midtl        weig        diet     foraging
wingl    0.0033279899 0.009076022 0.013795777 0.007335437  0.000867154
taill    0.0045963476 0.006024241 0.006675840 0.005950454 -0.001487039
culml    0.0008074234 0.003910441 0.006450975 0.002283169  0.002128712
bilh     0.0045461170 0.007724854 0.009313112 0.009772576  0.003741598
billw    0.0052268952 0.008027585 0.009517696 0.006060185  0.001734456
tarsl    0.0121404053 0.008768413 0.005213359 0.012059499  0.001091060
midtl    0.0087684127 0.012698649 0.011907271 0.010078733  0.002671984
weig     0.0052133590 0.011907271 0.016743058 0.010860104  0.002614463
diet     0.0120594992 0.010078733 0.010860104 0.114866122  0.004669637
foraging 0.0010910596 0.002671984 0.002614463 0.004669637  0.114531953

\$paircor
wingl       taill      culml       bilh      billw      tarsl
wingl    1.0000000  0.68997709 0.45603991 0.46056482 0.65079056 0.22982189
taill    0.6899771  1.00000000 0.26543488 0.37731346 0.56105209 0.46581526
culml    0.4560399  0.26543488 1.00000000 0.21803961 0.38559820 0.05932358
bilh     0.4605648  0.37731346 0.21803961 1.00000000 0.68504660 0.28891581
billw    0.6507906  0.56105209 0.38559820 0.68504660 1.00000000 0.39714428
tarsl    0.2298219  0.46581526 0.05932358 0.28891581 0.39714428 1.00000000
midtl    0.6128339  0.59695417 0.28092446 0.48001941 0.59638579 0.70619661
weig     0.8112501  0.57611071 0.40359941 0.50399324 0.61579412 0.36566522
diet     0.1646857  0.19605215 0.05453617 0.20191119 0.14969628 0.32293618
foraging 0.0194966 -0.04906552 0.05092092 0.07741784 0.04290629 0.02925961
midtl       weig       diet    foraging
wingl    0.61283391 0.81125012 0.16468573  0.01949660
taill    0.59695417 0.57611071 0.19605215 -0.04906552
culml    0.28092446 0.40359941 0.05453617  0.05092092
bilh     0.48001941 0.50399324 0.20191119  0.07741784
billw    0.59638579 0.61579412 0.14969628  0.04290629
tarsl    0.70619661 0.36566522 0.32293618  0.02925961
midtl    1.00000000 0.81661265 0.26389503  0.07006349
weig     0.81661265 1.00000000 0.24763989  0.05970377
diet     0.26389503 0.24763989 1.00000000  0.04071213
foraging 0.07006349 0.05970377 0.04071213  1.00000000

\$glocor
global distance
wingl          0.6903892
taill          0.6082382
culml          0.4328616
bilh           0.6237976
billw          0.6922475
tarsl          0.5528580
midtl          0.7567941
weig           0.7585159
diet           0.5721922
foraging       0.4129843

>
> # With a range of variables
> data(woangers)
>
> traits <- woangers\$traits
> # Nominal variables 'li', 'pr', 'lp' and 'le'
> # (see table 1 in the main text for the codes of the variables)
> tabN <- traits[,c(1:2, 7, 8)]
> # Circular variable 'fo'
> tabC <- traits[3]
> tabCp <- prep.circular(tabC, 1, 12)
> # The levels of the variable lie between 1 (January) and 12 (December).
> # Ordinal variables 'he', 'ae' and 'un'
> tabO <- traits[, 4:6]
> # Fuzzy variables 'mp', 'pe' and 'di'
> tabF <- traits[, 9:19]
> tabFp <- prep.fuzzy(tabF, c(3, 3, 5), labels = c("mp", "pe", "di"))
> # 'mp' has 3 levels, 'pe' has 3 levels and 'di' has 5 levels.
> # Quantitative variables 'lo' and 'lf'
> tabQ <- traits[, 20:21]
> ktab1 <- ktab.list.df(list(tabN, tabCp, tabO, tabFp, tabQ))
> distrait <- dist.ktab(ktab1, c("N", "C", "O", "F", "Q"))
> is.euclid(distrait)
[1] FALSE
> contrib <- kdist.cor(ktab1, type = c("N", "C", "O", "F", "Q"))
> contrib
\$paircov
li            pr           lp            le            fo
li  0.2500534939  2.471981e-02  0.038851022  0.0200445124  1.447475e-03
pr  0.0247198080  1.997226e-01 -0.030237798 -0.0018367708 -4.197371e-05
lp  0.0388510224 -3.023780e-02  0.244163852  0.0367008519 -5.703983e-03
le  0.0200445124 -1.836771e-03  0.036700852  0.2154214983 -1.559745e-03
fo  0.0014474751 -4.197371e-05 -0.005703983 -0.0015597448  4.528208e-02
he  0.0680421313  8.466469e-04  0.025604692  0.0212553246 -1.418924e-03
ae -0.0018812563 -1.601963e-02  0.008221023  0.0057194746  1.306038e-02
un  0.0036063382  1.516450e-02 -0.010585786  0.0143104555  7.271514e-03
mp  0.0024114632 -1.555895e-02  0.013304589 -0.0069409683 -2.963572e-03
pe -0.0003519038 -1.142511e-02  0.004390976  0.0097460052 -6.007740e-03
di  0.0592153472 -1.385170e-02  0.044325306  0.0145622107 -2.335351e-03
lo  0.0091396503  9.856243e-03 -0.001868482  0.0121343465  3.625808e-03
lf  0.0002981235  4.051590e-03  0.003811518  0.0003994357 -1.510210e-03
he            ae            un            mp            pe
li  0.0680421313 -0.0018812563  0.0036063382  0.0024114632 -0.0003519038
pr  0.0008466469 -0.0160196292  0.0151645015 -0.0155589542 -0.0114251127
lp  0.0256046923  0.0082210230 -0.0105857858  0.0133045886  0.0043909764
le  0.0212553246  0.0057194746  0.0143104555 -0.0069409683  0.0097460052
fo -0.0014189236  0.0130603753  0.0072715136 -0.0029635716 -0.0060077398
he  0.0574719777  0.0070992310 -0.0010677103  0.0041920534 -0.0082371855
ae  0.0070992310  0.1326613899 -0.0055169804 -0.0119644203 -0.0081662316
un -0.0010677103 -0.0055169804  0.1728843882 -0.0058348243 -0.0072676018
mp  0.0041920534 -0.0119644203 -0.0058348243  0.1950443384  0.0008347567
pe -0.0082371855 -0.0081662316 -0.0072676018  0.0008347567  0.0877808785
di  0.0241651036 -0.0009142773  0.0066962660  0.0278340279  0.0095001949
lo  0.0033306640 -0.0030305774  0.0078721307 -0.0089371746 -0.0077967582
lf -0.0026447598 -0.0002323546  0.0001973648  0.0034482577  0.0004945621
di           lo            lf
li  0.0592153472  0.009139650  0.0002981235
pr -0.0138516994  0.009856243  0.0040515896
lp  0.0443253062 -0.001868482  0.0038115180
le  0.0145622107  0.012134346  0.0003994357
fo -0.0023353509  0.003625808 -0.0015102103
he  0.0241651036  0.003330664 -0.0026447598
ae -0.0009142773 -0.003030577 -0.0002323546
un  0.0066962660  0.007872131  0.0001973648
mp  0.0278340279 -0.008937175  0.0034482577
pe  0.0095001949 -0.007796758  0.0004945621
di  0.1841159926  0.014572402  0.0024682582
lo  0.0145724018  0.061043909 -0.0014773201
lf  0.0024682582 -0.001477320  0.0209363204

\$paircor
li            pr          lp           le            fo
li  1.000000000  0.1106152512  0.15723358  0.086362888  0.0136028981
pr  0.110615251  1.0000000000 -0.13692913 -0.009009945 -0.0004413677
lp  0.157233581 -0.1369291310  1.00000000  0.159827877 -0.0542468263
le  0.086362888 -0.0090099446  0.15982788  1.000000000 -0.0157493640
fo  0.013602898 -0.0004413677 -0.05424683 -0.015749364  1.0000000000
he  0.567588221  0.0079024292  0.21614779  0.189447455 -0.0278142752
ae -0.010328660 -0.0997944149  0.04556777  0.033606280  0.1681535156
un  0.017344303  0.0827515807 -0.05139838  0.073910180  0.0820105076
mp  0.010919468 -0.0785817255  0.06123574 -0.033911383 -0.0321943061
pe -0.002375240 -0.0862873064  0.02999304  0.070507551 -0.0952901382
di  0.275979010 -0.0720054108  0.20879827  0.073540182 -0.0255916725
lo  0.073965943  0.0922461136 -0.01520356  0.107350984  0.0690026317
lf  0.004120307  0.0626558533  0.05330981  0.005937895 -0.0490483097
he           ae          un           mp           pe           di
li  0.56758822 -0.010328660  0.01734430  0.010919468 -0.002375240  0.275979010
pr  0.00790243 -0.099794415  0.08275158 -0.078581726 -0.086287306 -0.072005411
lp  0.21614779  0.045567771 -0.05139838  0.061235742  0.029993038  0.208798270
le  0.18944745  0.033606280  0.07391018 -0.033911383  0.070507551  0.073540182
fo -0.02781428  0.168153516  0.08201051 -0.032194306 -0.095290138 -0.025591673
he  1.00000000  0.081759418 -0.01077145  0.039266816 -0.115971376  0.236949219
ae  0.08175942  1.000000000 -0.03642934 -0.074427901 -0.074891813 -0.006193944
un -0.01077145 -0.036429338  1.00000000 -0.032340431 -0.058384579  0.037654676
mp  0.03926682 -0.074427901 -0.03234043  1.000000000  0.006346682  0.146273813
pe -0.11597138 -0.074891813 -0.05838458  0.006346682  1.000000000  0.074343032
di  0.23694922 -0.006193944  0.03765468  0.146273813  0.074343032  1.000000000
lo  0.05630599 -0.034236757  0.07586800 -0.083443578 -0.096809073  0.144618408
lf -0.07624441 -0.004360944  0.00324484  0.053466747  0.011536411  0.039689434
lo           lf
li  0.07396594  0.004120307
pr  0.09224611  0.062655853
lp -0.01520356  0.053309808
le  0.10735098  0.005937895
fo  0.06900263 -0.049048310
he  0.05630599 -0.076244407
ae -0.03423676 -0.004360944
un  0.07586800  0.003244840
mp -0.08344358  0.053466747
pe -0.09680907  0.011536411
di  0.14461841  0.039689434
lo  1.00000000 -0.040074265
lf -0.04007426  1.000000000

\$glocor
global distance
li       0.5859411
pr       0.2309621
lp       0.4632443
le       0.4484787
fo       0.1331704
he       0.5098172
ae       0.1979766
un       0.2926322
mp       0.2867519
pe       0.1356886
di       0.5223928
lo       0.2492998
lf       0.1290551

> dotchart(sort(contrib\$glocor), labels = rownames(contrib\$glocor)[order(contrib\$glocor[, 1])])
```
```>
>
>
>
>
```