Creditos: diegokjkjj
setwd("G:/Meu Drive/UFPE/2021.1/Ecologia Numérica")
load("G:/Meu Drive/UFPE/2021.1/Ecologia Numérica/NEwR-2ed_code_data (2)/NEwR-2ed_code_data/NEwR2-Data/Doubs.RData")
library(ade4)
library(vegan)
## Carregando pacotes exigidos: permute
## Carregando pacotes exigidos: lattice
## This is vegan 2.5-7
library(gclus)
## Carregando pacotes exigidos: cluster
## Registered S3 method overwritten by 'gclus':
## method from
## reorder.hclust vegan
library(cluster)
library(FD)
## Carregando pacotes exigidos: ape
## Carregando pacotes exigidos: geometry
library(usedist)
library(dendextend)
## Registered S3 method overwritten by 'dendextend':
## method from
## rev.hclust vegan
##
## ---------------------
## Welcome to dendextend version 1.15.2
## Type citation('dendextend') for how to cite the package.
##
## Type browseVignettes(package = 'dendextend') for the package vignette.
## The github page is: https://github.com/talgalili/dendextend/
##
## Suggestions and bug-reports can be submitted at: https://github.com/talgalili/dendextend/issues
## You may ask questions at stackoverflow, use the r and dendextend tags:
## https://stackoverflow.com/questions/tagged/dendextend
##
## To suppress this message use: suppressPackageStartupMessages(library(dendextend))
## ---------------------
##
## Attaching package: 'dendextend'
## The following objects are masked from 'package:ape':
##
## ladderize, rotate
## The following object is masked from 'package:gclus':
##
## order.hclust
## The following object is masked from 'package:permute':
##
## shuffle
## The following object is masked from 'package:stats':
##
## cutree
rio<-c(rep("alto", 10), rep("medio",10), rep("baixo",10))
spe$rio<-rio
spa$rio<-rio
env$rio<-rio
SpeAnl<-vegdist(spe[,-28], method = "jaccard")
## Warning in vegdist(spe[, -28], method = "jaccard"): you have empty rows: their
## dissimilarities may be meaningless in method "jaccard"
SpeAnl
## 1 2 3 4 5 6 7
## 2 0.7500000
## 3 0.8125000 0.2500000
## 4 0.8571429 0.5000000 0.3181818
## 5 0.9428571 0.8205128 0.8095238 0.6585366
## 6 0.8571429 0.5652174 0.4583333 0.3200000 0.5897436
## 7 0.8125000 0.2500000 0.2222222 0.3913043 0.7804878 0.3913043
## 8 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
## 9 1.0000000 0.8181818 0.8461538 0.7931034 0.7368421 0.7037037 0.8000000
## 10 0.9375000 0.5555556 0.5714286 0.5416667 0.7027027 0.4090909 0.4210526
## 11 0.7272727 0.4666667 0.5789474 0.6086957 0.8157895 0.6086957 0.5000000
## 12 0.8333333 0.3333333 0.3809524 0.5000000 0.8181818 0.5555556 0.3000000
## 13 0.8421053 0.4500000 0.4782609 0.6206897 0.8478261 0.7096774 0.5416667
## 14 0.8928571 0.5714286 0.4827586 0.5151515 0.8076923 0.6000000 0.5333333
## 15 0.9090909 0.6764706 0.6388889 0.5789474 0.7115385 0.5405405 0.5588235
## 16 0.9250000 0.7906977 0.7272727 0.6444444 0.6296296 0.5476190 0.6976744
## 17 0.9555556 0.8085106 0.7755102 0.6734694 0.6779661 0.6170213 0.7500000
## 18 0.9772727 0.8510638 0.8400000 0.7400000 0.6666667 0.6875000 0.8163265
## 19 1.0000000 0.8846154 0.8301887 0.7592593 0.6666667 0.6862745 0.8076923
## 20 1.0000000 0.9538462 0.9411765 0.8507463 0.6567164 0.8153846 0.9253731
## 21 1.0000000 0.9722222 0.9600000 0.8783784 0.6666667 0.8472222 0.9459459
## 22 1.0000000 0.9879518 0.9767442 0.9058824 0.6913580 0.8795181 0.9647059
## 23 1.0000000 1.0000000 1.0000000 0.9583333 0.9444444 0.9130435 0.9473684
## 24 1.0000000 1.0000000 1.0000000 0.9411765 0.8863636 0.8750000 0.9666667
## 25 1.0000000 1.0000000 0.9615385 0.8965517 0.8157895 0.8148148 0.9200000
## 26 1.0000000 0.9814815 0.9649123 0.8771930 0.7166667 0.8148148 0.9464286
## 27 1.0000000 0.9864865 0.9740260 0.9090909 0.7236842 0.8648649 0.9605263
## 28 1.0000000 0.9876543 0.9761905 0.9036145 0.7317073 0.8765432 0.9638554
## 29 0.9887640 0.9687500 0.9595960 0.8979592 0.6989247 0.8750000 0.9489796
## 30 1.0000000 1.0000000 0.9903846 0.9320388 0.7448980 0.9108911 0.9805825
## 8 9 10 11 12 13 14
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9 1.0000000
## 10 1.0000000 0.7272727
## 11 1.0000000 0.8636364 0.6111111
## 12 1.0000000 0.8148148 0.5454545 0.3888889
## 13 1.0000000 0.9000000 0.7307692 0.5000000 0.3181818
## 14 1.0000000 0.8648649 0.6451613 0.6071429 0.3571429 0.3214286
## 15 1.0000000 0.7948718 0.5757576 0.6666667 0.5000000 0.5555556 0.3947368
## 16 1.0000000 0.8260870 0.6829268 0.7857143 0.7111111 0.7446809 0.6122449
## 17 1.0000000 0.8163265 0.6818182 0.7777778 0.7346939 0.7647059 0.6666667
## 18 1.0000000 0.7826087 0.7272727 0.8222222 0.8000000 0.8269231 0.7500000
## 19 1.0000000 0.8000000 0.7755102 0.9038462 0.8571429 0.8983051 0.8064516
## 20 1.0000000 0.8135593 0.8709677 0.9531250 0.9428571 0.9583333 0.9090909
## 21 1.0000000 0.8656716 0.8985507 0.9571429 0.9610390 0.9746835 0.9285714
## 22 1.0000000 0.8684211 0.9250000 0.9753086 0.9772727 0.9888889 0.9473684
## 23 1.0000000 0.8750000 0.9411765 0.9285714 0.9523810 1.0000000 0.9677419
## 24 1.0000000 0.8400000 0.8846154 0.9600000 0.9687500 1.0000000 0.9512195
## 25 1.0000000 0.9130435 0.8636364 0.9523810 0.9642857 1.0000000 0.9166667
## 26 1.0000000 0.8367347 0.9038462 0.9615385 0.9661017 0.9836066 0.9242424
## 27 1.0000000 0.8676471 0.9154930 0.9722222 0.9746835 0.9876543 0.9418605
## 28 1.0000000 0.8648649 0.9230769 0.9746835 0.9767442 0.9886364 0.9462366
## 29 1.0000000 0.8777778 0.9139785 0.9462366 0.9500000 0.9504950 0.9150943
## 30 1.0000000 0.9157895 0.9489796 0.9898990 0.9905660 1.0000000 0.9646018
## 15 16 17 18 19 20 21
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16 0.4130435
## 17 0.5740741 0.4150943
## 18 0.6363636 0.5090909 0.2448980
## 19 0.7258065 0.5666667 0.4745763 0.4000000
## 20 0.8289474 0.7368421 0.5915493 0.4923077 0.3809524
## 21 0.8690476 0.7710843 0.6582278 0.5753425 0.4571429 0.1846154
## 22 0.8709677 0.7956989 0.7111111 0.6428571 0.5609756 0.3157895 0.1891892
## 23 0.9722222 0.9523810 0.9090909 0.9047619 0.9130435 0.9285714 0.9354839
## 24 0.9333333 0.9000000 0.8200000 0.7872340 0.7800000 0.7321429 0.7580645
## 25 0.9000000 0.8666667 0.8541667 0.7954545 0.7608696 0.8035714 0.8225806
## 26 0.8656716 0.7794118 0.7014925 0.6290323 0.4915254 0.3500000 0.3333333
## 27 0.8705882 0.8023256 0.7261905 0.6538462 0.5466667 0.3239437 0.2394366
## 28 0.8804348 0.8172043 0.7333333 0.6666667 0.5853659 0.3636364 0.2857143
## 29 0.8461538 0.7904762 0.6767677 0.6129032 0.5851064 0.3932584 0.3068182
## 30 0.9009009 0.8378378 0.7333333 0.6900000 0.6500000 0.4574468 0.3763441
## 22 23 24 25 26 27 28
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16
## 17
## 18
## 19
## 20
## 21
## 22
## 23 0.9444444
## 24 0.7916667 0.7333333
## 25 0.8472222 0.6363636 0.6315789
## 26 0.4027778 0.9069767 0.6511628 0.7441860
## 27 0.2236842 0.9365079 0.7619048 0.8253968 0.3174603
## 28 0.2250000 0.9428571 0.7857143 0.8428571 0.3857143 0.1780822
## 29 0.2134831 0.9540230 0.8275862 0.8735632 0.5057471 0.3146067 0.2555556
## 30 0.3052632 0.9550562 0.8314607 0.8764045 0.5333333 0.3296703 0.2717391
## 29
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16
## 17
## 18
## 19
## 20
## 21
## 22
## 23
## 24
## 25
## 26
## 27
## 28
## 29
## 30 0.2574257
mean(SpeAnl)
## [1] 0.7704207
mean(dist_subset(SpeAnl, c(1:8)))
## [1] 0.6913397
mean(dist_subset(SpeAnl, c(9:18)))
## [1] 0.6442179
mean(dist_subset(SpeAnl, c(19:28)))
## [1] 0.5946113
clust<-hclust(SpeAnl, method = "complete")
clustgraf<-plot(clust, hang=-1,main="Índice de Jaccard das Comunidades de peixes")
clustgraf
## NULL
clust2<-as.dendrogram(clust)
colors<-c("red","gold", "darkgreen")
colorCode<-c(alto=colors[1], medio=colors[2], baixo=colors[3])
labels_colors(clust2)<-colorCode[rio][order.dendrogram(clust2)]
plot(clust2,main="Índice de Jaccard das Comunidades de Peixes",ylab="Height")
SpeAnl2<-vegdist(spe[,-28], method = "euclidean")
SpeAnl2
## 1 2 3 4 5 6 7
## 2 5.385165
## 3 7.416198 2.449490
## 4 7.874008 4.123106 3.000000
## 5 10.816654 10.677078 10.862780 9.219544
## 6 7.348469 4.582576 4.123106 2.828427 8.185353
## 7 6.855655 2.449490 2.000000 3.605551 10.488088 3.605551
## 8 3.000000 7.071068 8.717798 8.774964 10.954451 7.937254 8.246211
## 9 7.810250 8.717798 9.380832 8.774964 9.380832 6.708204 8.485281
## 10 6.708204 5.099020 5.291503 5.000000 9.273618 3.605551 4.472136
## 11 4.472136 3.316625 5.000000 5.477226 10.246951 5.291503 4.795832
## 12 6.708204 3.162278 3.464102 4.582576 11.045361 4.795832 3.162278
## 13 7.071068 4.358899 5.196152 6.164414 11.532563 6.633250 5.385165
## 14 9.110434 6.324555 6.164414 6.557439 11.916375 7.000000 6.324555
## 15 9.899495 7.810250 7.681146 7.483315 10.816654 6.633250 6.855655
## 16 11.090537 9.899495 9.797959 9.327379 10.198039 8.426150 9.055385
## 17 10.630146 9.486833 9.486833 8.774964 9.797959 8.062258 9.055385
## 18 9.848858 9.591663 9.899495 8.660254 9.055385 7.810250 9.380832
## 19 11.704700 11.135529 11.045361 10.148892 9.380832 8.888194 10.770330
## 20 13.453624 14.212670 14.628739 13.453624 10.770330 12.206556 14.212670
## 21 14.456832 15.362291 15.811388 14.525839 11.489125 13.601471 15.556349
## 22 16.643317 17.663522 18.110770 16.763055 13.416408 15.779734 17.663522
## 23 3.872983 7.483315 9.055385 9.000000 10.583005 7.937254 8.485281
## 24 7.071068 9.539392 10.816654 10.583005 11.357817 9.486833 10.246951
## 25 5.291503 8.306624 9.643651 9.273618 9.746794 8.246211 9.110434
## 26 11.135529 12.609520 13.304135 12.409674 10.723805 11.224972 12.922848
## 27 15.362291 16.462078 16.881943 15.811388 13.076697 14.696938 16.583124
## 28 16.522712 17.549929 18.000000 16.941074 14.352700 15.905974 17.606817
## 29 18.761663 19.364917 19.621417 18.384776 15.524175 17.776389 19.364917
## 30 20.396078 21.377558 21.794495 20.542639 17.117243 19.849433 21.517435
## 8 9 10 11 12 13 14
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9 7.211103
## 10 6.480741 6.480741
## 11 5.385165 7.549834 4.582576
## 12 8.124038 8.717798 5.477226 3.872983
## 13 8.426150 10.049876 6.855655 4.000000 3.316625
## 14 10.198039 10.583005 7.615773 6.244998 4.242641 3.316625
## 15 10.630146 9.746794 6.855655 7.745967 6.403124 6.633250 5.000000
## 16 11.489125 10.862780 8.485281 10.049876 9.591663 9.746794 8.944272
## 17 10.770330 9.899495 8.246211 9.219544 9.273618 9.643651 9.380832
## 18 9.695360 8.602325 7.874008 8.774964 9.380832 9.949874 9.797959
## 19 11.313708 9.486833 9.273618 11.000000 11.313708 12.041595 11.832160
## 20 13.114877 11.489125 12.727922 13.527749 14.422205 15.000000 14.966630
## 21 14.142136 13.266499 14.142136 14.662878 15.684387 16.031220 16.062378
## 22 16.370706 15.033296 16.248077 16.941074 17.832555 18.303005 18.165902
## 23 2.449490 6.324555 6.633250 5.744563 8.366600 8.774964 10.392305
## 24 6.403124 7.549834 8.544004 8.124038 10.148892 10.583005 11.789826
## 25 4.358899 7.280110 7.000000 6.782330 9.110434 9.486833 10.723805
## 26 10.723805 10.148892 11.445523 11.747340 13.000000 13.490738 13.892444
## 27 15.066519 13.892444 15.264338 15.748016 16.703293 17.146428 17.117243
## 28 16.248077 14.899664 16.309506 16.822604 17.720045 18.193405 18.220867
## 29 18.681542 17.521415 18.303005 18.761663 19.416488 19.646883 19.313208
## 30 20.174241 19.467922 20.371549 20.736441 21.610183 21.863211 21.931712
## 15 16 17 18 19 20 21
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16 5.916080
## 17 8.185353 6.164414
## 18 8.660254 7.615773 3.464102
## 19 10.630146 9.165151 6.633250 6.000000
## 20 13.674794 12.649111 9.380832 7.615773 6.324555
## 21 15.066519 13.928388 11.224972 9.380832 7.874008 3.741657
## 22 16.763055 15.556349 13.416408 11.489125 10.583005 6.480741 4.000000
## 23 10.630146 11.489125 10.295630 9.055385 10.488088 11.916375 13.114877
## 24 11.747340 12.449900 10.723805 9.110434 9.746794 10.148892 11.269428
## 25 10.583005 11.180340 10.148892 8.660254 9.539392 10.630146 11.618950
## 26 13.190906 13.076697 10.816654 8.774964 7.810250 5.385165 5.385165
## 27 16.062378 15.329710 13.304135 11.532563 10.246951 6.244998 4.582576
## 28 17.175564 16.370706 14.352700 12.489996 11.489125 7.745967 6.000000
## 29 18.330303 17.058722 14.662878 13.076697 12.767145 9.000000 7.000000
## 30 21.023796 19.621417 17.117243 15.652476 15.000000 11.180340 9.000000
## 22 23 24 25 26 27 28
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16
## 17
## 18
## 19
## 20
## 21
## 22
## 23 15.362291
## 24 13.304135 4.358899
## 25 13.964240 3.000000 3.741657
## 26 7.549834 9.433981 7.071068 8.000000
## 27 5.000000 14.035669 11.916375 12.649111 5.291503
## 28 5.099020 15.231546 13.076697 13.964240 7.000000 3.872983
## 29 5.567764 17.804494 15.874508 16.431677 9.899495 6.633250 5.567764
## 30 8.185353 19.416488 17.832555 18.055470 11.916375 9.165151 7.280110
## 29
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16
## 17
## 18
## 19
## 20
## 21
## 22
## 23
## 24
## 25
## 26
## 27
## 28
## 29
## 30 6.480741
mean(SpeAnl2)
## [1] 10.77602
mean(dist_subset(SpeAnl2, c(1:8)))
## [1] 6.521358
mean(dist_subset(SpeAnl2, c(9:18)))
## [1] 7.622691
mean(dist_subset(SpeAnl2, c(19:28)))
## [1] 8.78423
clust2<-hclust(SpeAnl2, method = "complete")
clustgraf2<-plot(clust2, hang=-1,main="Distância Euclideana das Comunidades de Peixes")
clustgraf2
## NULL
clust2.1<-as.dendrogram(clust2)
colors2<-c("red","gold", "darkgreen")
colorCode2<-c(alto=colors2[1], medio=colors2[2], baixo=colors2[3])
labels_colors(clust2.1)<-colorCode2[rio][order.dendrogram(clust2.1)]
plot(clust2.1,main="Distância Euclideana das Comunidades de peixes",ylab="Height")
env[,-c(1:7,12)]
## nit amm oxy bod
## 1 0.20 0.00 12.2 2.7
## 2 0.20 0.10 10.3 1.9
## 3 0.22 0.05 10.5 3.5
## 4 0.21 0.00 11.0 1.3
## 5 0.52 0.20 8.0 6.2
## 6 0.15 0.00 10.2 5.3
## 7 0.15 0.00 11.1 2.2
## 8 0.41 0.12 7.0 8.1
## 9 0.82 0.12 7.2 5.2
## 10 0.75 0.01 10.0 4.3
## 11 1.60 0.00 11.5 2.7
## 12 0.50 0.00 12.2 3.0
## 13 0.52 0.00 12.4 2.4
## 14 1.23 0.00 12.3 3.8
## 15 1.00 0.00 11.7 2.1
## 16 2.00 0.05 10.3 2.7
## 17 2.50 0.20 10.2 4.6
## 18 2.20 0.20 10.3 2.8
## 19 2.20 0.15 10.6 3.3
## 20 3.00 0.30 10.3 2.8
## 21 2.20 0.10 9.0 4.1
## 22 1.62 0.07 9.1 4.8
## 23 3.50 1.15 6.3 16.4
## 24 2.50 0.60 5.2 12.3
## 25 6.20 1.80 4.1 16.7
## 26 3.00 0.30 6.2 8.9
## 27 3.00 0.26 7.2 6.3
## 28 4.00 0.30 8.1 4.5
## 29 1.62 0.10 9.0 4.2
## 30 1.60 0.10 8.2 4.4
EnvAnl<-vegdist(env[,-c(1:7,12)],method = "euclidean")
EnvAnl
## 1 2 3 4 5 6 7
## 2 2.0639767
## 3 1.8796010 1.6133506
## 4 1.8439360 0.9274158 2.2566790
## 5 5.4801825 4.8879853 3.6949290 5.7572650
## 6 3.2806249 3.4033072 1.8268552 4.0796568 2.4138973
## 7 1.2093387 0.8616844 1.4343640 0.9075241 5.0780803 3.2280025
## 8 7.5005666 7.0266991 5.7836839 7.8926802 2.1513949 4.2616898 7.1904103
## 9 5.6257266 4.5699891 3.7609706 5.4805565 1.3177253 3.0778726 4.9672226
## 10 2.7753558 2.4820556 1.0828204 3.2080680 2.7747072 1.1832582 2.4454243
## 11 1.5652476 2.0124612 1.8833215 2.0352150 5.0701479 3.2484612 1.5850867
## 12 0.4242641 2.2181073 1.7946866 2.1009760 5.2839758 3.0679798 1.4044572
## 13 0.4820788 2.1845823 2.2164160 1.8072355 5.8172158 3.6588113 1.3663455
## 14 1.5102649 2.9463367 2.0862886 2.9967316 4.9793674 2.7975704 2.2729716
## 15 1.1180340 1.6278821 2.0027231 1.3244244 5.5471074 3.6349003 1.0452272
## 16 2.6177280 1.9704060 1.9617339 2.3783608 4.4444235 3.1929610 2.0772578
## 17 3.5972211 3.5496479 2.5536053 4.1005000 3.3645802 2.4601829 3.4831738
## 18 2.7676705 2.1954498 2.1149232 2.5961703 4.4353579 3.2407561 2.2896506
## 19 2.6348624 2.4601829 1.9950940 2.8535241 4.2420396 2.8956864 2.3843238
## 20 3.3985291 2.9478806 2.8845970 3.2579288 4.7969157 3.8042739 3.0352100
## 21 4.0261644 3.2449961 2.5559538 3.9761916 2.8709580 2.6631748 3.4974991
## 22 4.0051592 3.4448948 2.3686283 4.2252811 2.0968786 1.9041534 3.5952469
## 23 15.3203296 15.4351061 14.0006571 16.1940298 10.8033745 12.2867815 15.4021102
## 24 12.1165177 11.8198985 10.5371201 12.6587559 7.0093081 8.9377010 11.9458152
## 25 17.3450281 17.2154001 15.9380959 17.9969470 12.6602686 14.3879290 17.2942910
## 26 9.0757920 8.5842880 7.4458646 9.4166926 4.0853886 6.0969255 8.7813723
## 27 6.7725623 6.0692339 5.1480579 6.8768961 2.6084478 4.2649853 6.3411434
## 28 5.8804762 5.1068581 4.5946599 5.7536163 3.8756161 4.4679414 5.4039338
## 29 3.8100394 2.9993999 2.1685248 3.7958003 2.4939928 2.1956548 3.2528295
## 30 4.5672749 3.5524639 2.8296466 4.4036462 2.1110187 2.6310644 3.9195025
## 8 9 10 11 12 13 14
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9 2.9356601
## 10 4.8546576 2.9439769
## 11 7.1302524 5.0361493 2.3521480
## 12 7.2850875 5.4732806 2.5676059 1.3379088
## 13 7.8534387 5.9147612 3.0696905 1.4374978 0.6327717
## 14 6.8750855 5.3058930 2.4021865 1.4095744 1.0876121 1.5729272
## 15 7.6454235 5.4687110 2.7915229 0.8717798 1.1445523 0.9002222 1.8173882
## 16 6.5255651 4.1541907 2.0528273 1.2658989 2.4397746 2.5870640 2.4094398
## 17 5.1830975 3.4912462 1.7968305 2.4799194 3.2557641 3.6932912 2.5889959
## 18 6.4954215 4.1570182 2.1162703 1.3601471 2.5651511 2.7262428 2.4455879
## 19 6.2613896 4.1322270 1.8660386 1.2459936 2.3584953 2.6258142 2.0256851
## 20 6.7616936 4.4894098 2.7361652 1.8708287 3.1606961 3.2879173 2.8675599
## 21 4.8171049 2.5208729 1.7749930 2.9291637 3.7881394 4.1572106 3.4541135
## 22 4.0947039 2.1005952 1.3492591 3.1898746 3.7562348 4.2266890 3.3759443
## 23 8.9436570 11.5971246 12.9985422 14.8210155 14.9897465 15.6016954 14.1857464
## 24 5.0476232 7.5804222 9.5105520 11.5334297 11.8258192 12.4149265 11.1639106
## 25 10.8957102 13.1767523 14.8820899 16.5879474 17.0008823 17.5750505 16.1737720
## 26 2.8320487 4.4130262 6.3833064 8.2813042 8.7835073 9.3236474 8.1512514
## 27 3.1634949 2.4458127 4.1188591 5.7859831 6.4967376 6.9618963 5.9548720
## 28 5.2048535 3.3830164 3.7810845 4.5442271 5.6035703 5.9245591 5.0885067
## 29 4.5469220 2.2091627 1.3322913 2.9172590 3.5978327 4.0024992 3.3484474
## 30 4.0677389 1.4995999 1.9951441 3.7134889 4.3794977 4.7766515 4.1613580
## 15 16 17 18 19 20 21
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16 1.8227726
## 17 3.2848135 1.9729420
## 18 1.9824228 0.2692582 1.8275667
## 19 2.0279300 0.7071068 1.3937360 0.5852350
## 20 2.5573424 1.0356158 1.8734994 0.8062258 1.0012492
## 21 3.5693137 1.9215879 1.3379088 1.8411953 1.7895530 2.0149442
## 22 3.7999079 2.4484281 1.4287407 2.4069275 2.2006363 2.7197978 0.9150410
## 23 15.5313393 14.3927065 12.5040993 14.2671826 13.8848839 14.2102956 12.7032476
## 24 12.2024588 10.8959855 9.1896681 10.7939798 10.5096384 10.7981480 9.0564894
## 25 17.3551145 15.9731806 14.1375387 15.8180277 15.5091102 15.6249800 14.2007042
## 26 8.9766363 7.5041655 5.8949131 7.3939164 7.1681588 7.3498299 5.6178288
## 27 6.4774686 4.8594341 3.4847669 4.7437959 4.6056596 4.6756390 2.9572961
## 28 5.2735187 3.4846090 2.5845696 3.3136083 3.3094561 2.9546573 2.0615528
## 29 3.4777004 2.0216083 1.5441503 1.9990998 1.9258505 2.3652484 0.5885576
## 30 4.2320208 2.7317577 2.2045408 2.7092434 2.7078589 2.9949958 1.0440307
## 22 23 24 25 26 27 28
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16
## 17
## 18
## 19
## 20
## 21
## 22
## 23 12.1285119
## 24 8.5155916 4.3957366
## 25 13.8050462 3.5556293 5.9749477
## 26 5.2131852 7.5652165 3.5916570 8.8170290
## 27 2.7929375 10.1912757 6.3533928 11.4184763 2.7859648
## 28 2.6090803 12.0756987 8.4610874 13.1122081 4.8959167 2.2475765
## 29 0.6090156 12.6793888 9.0041324 14.2872811 5.6457418 3.0951575 2.5699027
## 30 0.9855455 12.3419002 8.5129313 13.8618181 5.1234754 2.5681900 2.4124676
## 29
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## 16
## 17
## 18
## 19
## 20
## 21
## 22
## 23
## 24
## 25
## 26
## 27
## 28
## 29
## 30 0.8248636
mean(EnvAnl)
## [1] 5.154318
mean(dist_subset(EnvAnl, c(1:10)))
## [1] 3.453818
mean(dist_subset(EnvAnl, c(11:20)))
## [1] 1.880449
mean(dist_subset(EnvAnl, c(21:30)))
## [1] 6.537172
clust3<-hclust(EnvAnl, method = "complete")
clustgraf3<-plot(clust3, hang=-1,main="Distância Euclidiana das Variáveis ambientais")
clustgraf3
## NULL
clust3.1<-as.dendrogram(clust3)
colors3<-c("red","gold", "darkgreen")
colorCode3<-c(alto=colors3[1], medio=colors3[2], baixo=colors3[3])
labels_colors(clust3.1)<-colorCode2[rio][order.dendrogram(clust3.1)]
plot(clust3.1,main="Distância Euclidiana das Variáveis ambientais",ylab="Height")