Josh Birds

Load an prepare data

josh <- read.csv("~/Downloads/josh.csv")

josh
                      common.name                       latin.name survey
1                   Burrowing Owl               Athene cunicularia      1
2                Cliff Flycatcher           Forpus xanthopterygius      1
3                  Great Kiskadee                       Ardea alba      1
4               Great White Egret                  Tangara seledon      1
5            Green Headed Tanager        Phyllomyias griseocapilla      1
6              Red Rumped Cacique                Phaethornis ruber      1
7               Ruddy Ground Dove                  Furnarius rufus      1
8                  Rufous Hornero                 Sicalis flaveola      1
9                   Saffron Finch         Buteogallus meridionalis      1
10              Smooth Billed Ani            Thamnophilus ambiguus      1
11      Sooretema Slaty Antshrike             Corythopis delalandi      1
12              Southern Antpipit                Troglodytes aedon      1
13               Southern Lapwing        Stelgidopteryx ruficollis      1
14              Tropical Kingbird            Myrmotherula unicolor      1
15          White Bearded Manakin             Myrmoderus loricatus      1
16              White Necked Hawk         Xiphocolaptes albicollis      1
17        Black Cheeked Gnateater             Conopophaga melanops      2
18                   Cattle Egret      Ramphastos vitellinus ariel      2
19                 Great Kiskadee                       Ardea alba      2
20           Green Headed Tanager        Phyllomyias griseocapilla      2
21        Maroon Bellied Parakeet                Fluvicola nengeta      2
22         Ochre Collared Piculet                Turdus leucomelas      2
23          Pale Breasted Thrush           Patagioenas cayennensis      2
24                Planalto Hermit                     Habia rubica      2
25             Red Rumped Cacique                Phaethornis ruber      2
26                 Reddish Hermit            Tachyphonus coronatus      2
27                 Rufous Hornero                 Sicalis flaveola      2
28                  Saffron Finch         Buteogallus meridionalis      2
29                  Savannah Hawk                  Thraupis sayaca      2
30      Sooretema Slaty Antshrike             Corythopis delalandi      2
31          White Bearded Manakin             Myrmoderus loricatus      2
32          White Flanked Antwren         Buteogallus lacernulatus      2
33     White Throated Woodcreeper             Tangara brasiliensis      2
34         Yellow Headed Caracara               Milvago chimachima      2
35         Boat Billed Flycatcher             Megarynchus pitangua      3
36              Brazilian Tanager            Ramphocelus bresilius      3
37                  Burrowing Owl               Athene cunicularia      3
38               Crested Caracara               Loriotus cristatus      3
39                 Great Kiskadee                       Ardea alba      3
40           Green Headed Tanager        Phyllomyias griseocapilla      3
41         Grey Capped Tyrannulet        Todirostrum poliocephalum      3
42             Grey Hooded Attila                  Nemosia pileata      3
43            Masked Water Tyrant          Pheugopedius genibarbis      3
44         Olivaceous Woodcreeper        Sittasomus griseicapillus      3
45          Pale Breasted Thrush           Patagioenas cayennensis      3
46             Pale Vented Pigeon                Thraupis palmarum      3
47                   Palm Tanager              Phaethornis pretrei      3
48       Red Legged Honey Creeper              Cacicus haemorrhous      3
49             Red Rumped Cacique                Phaethornis ruber      3
50              Ruddy Ground Dove                  Furnarius rufus      3
51                 Rufous Hornero                 Sicalis flaveola      3
52                  Saffron Finch         Buteogallus meridionalis      3
53                  Savannah Hawk                  Thraupis sayaca      3
54              Smooth Billed Ani            Thamnophilus ambiguus      3
55              Southern Antpipit                Troglodytes aedon      3
56                Streaked Xenops         Xenops rutilans rutilans      3
57              Tropical Kingbird            Myrmotherula unicolor      3
58              Turquoise Tanager        Thamnophilus caerulescens      3
59            Violaceous Euphonia                    Bubulcus Ibis      3
60          White Bearded Manakin             Myrmoderus loricatus      3
61         Yellow Headed Caracara               Milvago chimachima      3
62        Black Cheeked Gnateater             Conopophaga melanops      4
63                    Blue Dacnis               Volatinia jacarina      4
64         Boat Billed Flycatcher             Megarynchus pitangua      4
65                  Burrowing Owl               Athene cunicularia      4
66          Channel Billed Toucan            Hirundinea ferruginea      4
67                 Great Kiskadee                       Ardea alba      4
68           Green Headed Tanager        Phyllomyias griseocapilla      4
69             Grey Hooded Attila                  Nemosia pileata      4
70                 Hooded Tanager             Xiphorhynchus fuscus      4
71        Maroon Bellied Parakeet                Fluvicola nengeta      4
72         Olivaceous Woodcreeper        Sittasomus griseicapillus      4
73             Pale Vented Pigeon                Thraupis palmarum      4
74             Red Rumped Cacique                Phaethornis ruber      4
75                 Reddish Hermit            Tachyphonus coronatus      4
76           Ruby Crowned Tanager              Columbina talpacoti      4
77              Ruddy Ground Dove                  Furnarius rufus      4
78                 Rufous Hornero                 Sicalis flaveola      4
79                  Saffron Finch         Buteogallus meridionalis      4
80              Smooth Billed Ani            Thamnophilus ambiguus      4
81            Southern House Wren               Vanellus chilensis      4
82            Streaked Flycatcher           Myiodynastes maculatus      4
83              Tropical Kingbird            Myrmotherula unicolor      4
84             Variable Antshrike             Thalurania glaucopis      4
85        Violet Capped Woodnymph               Syrigma sibilatrix      4
86                Whistling Heron                Picumnus cirratus      4
87          White Bearded Manakin             Myrmoderus loricatus      4
88           White Bibbed Antbird Myrmotherula axillaris luctuosa       4
89          White Flanked Antwren         Buteogallus lacernulatus      4
90     White Throated Woodcreeper             Tangara brasiliensis      4
91         Yellow Headed Caracara               Milvago chimachima      4
92        Black Cheeked Gnateater             Conopophaga melanops      5
93                    Blue Dacnis               Volatinia jacarina      5
94      Blonde Crested Woodpecker      Dacnis cayana paraguayensis      5
95                  Burrowing Owl               Athene cunicularia      5
96           Green Headed Tanager        Phyllomyias griseocapilla      5
97         Grey Capped Tyrannulet        Todirostrum poliocephalum      5
98             Lesser Woodcreeper               Pyrrhura frontalis      5
99        Maroon Bellied Parakeet                Fluvicola nengeta      5
100           Masked Water Tyrant          Pheugopedius genibarbis      5
101            Pale Vented Pigeon                Thraupis palmarum      5
102       Red Crowned Ant Tanager                Cyanerpes cyaneus      5
103            Red Rumped Cacique                Phaethornis ruber      5
104                Rufous Hornero                 Sicalis flaveola      5
105                 Saffron Finch         Buteogallus meridionalis      5
106                Scaled Antbird                   Crotophaga ani      5
107             Smooth Billed Ani            Thamnophilus ambiguus      5
108             Southern Antpipit                Troglodytes aedon      5
109           Streaked Flycatcher           Myiodynastes maculatus      5
110               Streaked Xenops         Xenops rutilans rutilans      5
111              Tawny Browed Owl           Tyrannus melancholicus      5
112             Tropical Kingbird            Myrmotherula unicolor      5
113           Unicoloured Antwren                Euphonia violacea      5
114           Violaceous Euphonia                    Bubulcus Ibis      5
115         White Bearded Manakin             Myrmoderus loricatus      5
116         Yellow Backed Tanager         Hemithraupis flavicollis      5
117        Yellow Bellied Elaenia              Elaenia flavogaster      5
118        Yellow Headed Caracara               Milvago chimachima      5
119          Blue Black Grassquit                Celeus flavescens      6
120                 Burrowing Owl               Athene cunicularia      6
121            Grey Hooded Attila                  Nemosia pileata      6
122         Pale Breasted Thrush           Patagioenas cayennensis      6
123            Pale Vented Pigeon                Thraupis palmarum      6
124       Red Crowned Ant Tanager                Cyanerpes cyaneus      6
125            Red Rumped Cacique                Phaethornis ruber      6
126             Ruddy Ground Dove                  Furnarius rufus      6
127                Rufous Hornero                 Sicalis flaveola      6
128                 Saffron Finch         Buteogallus meridionalis      6
129                Sayaca Tanager              Drymophila squamata      6
130             Smooth Billed Ani            Thamnophilus ambiguus      6
131             Southern Antpipit                Troglodytes aedon      6
132              Southern Lapwing        Stelgidopteryx ruficollis      6
133 Southern Rough Winged Swallow                     Piaya cayana      6
134             Tropical Kingbird            Myrmotherula unicolor      6
135       Violet Capped Woodnymph               Syrigma sibilatrix      6
136               Whistling Heron                Picumnus cirratus      6
137         White Bearded Manakin             Myrmoderus loricatus      6
138        Yellow Headed Caracara               Milvago chimachima      6
139       Black Cheeked Gnateater             Conopophaga melanops      7
140                   Blue Dacnis               Volatinia jacarina      7
141                 Burrowing Owl               Athene cunicularia      7
142                  Cattle Egret      Ramphastos vitellinus ariel      7
143         Flame Crested Tanager             Pitangus sulphuratus      7
144                Great Kiskadee                       Ardea alba      7
145          Green Headed Tanager        Phyllomyias griseocapilla      7
146   Grey Headed Tody Flycatcher                     Attila rufus      7
147      Red Legged Honey Creeper              Cacicus haemorrhous      7
148            Red Rumped Cacique                Phaethornis ruber      7
149                Rufous Hornero                 Sicalis flaveola      7
150                 Saffron Finch         Buteogallus meridionalis      7
151                Scaled Antbird                   Crotophaga ani      7
152             Smooth Billed Ani            Thamnophilus ambiguus      7
153              Southern Lapwing        Stelgidopteryx ruficollis      7
154           Streaked Flycatcher           Myiodynastes maculatus      7
155               Streaked Xenops         Xenops rutilans rutilans      7
156               Squirrel Cuckoo         Pulsatrix koeniswaldiana      7
157              Tawny Browed Owl           Tyrannus melancholicus      7
158             Tropical Kingbird            Myrmotherula unicolor      7
159           Unicoloured Antwren                Euphonia violacea      7
160       Violet Capped Woodnymph               Syrigma sibilatrix      7
161         White Bearded Manakin             Myrmoderus loricatus      7
162          Blue Black Grassquit                Celeus flavescens      8
163                   Blue Dacnis               Volatinia jacarina      8
164     Blonde Crested Woodpecker      Dacnis cayana paraguayensis      8
165                 Burrowing Owl               Athene cunicularia      8
166                  Cattle Egret      Ramphastos vitellinus ariel      8
167       Cobalt Rumped Parrotlet                 Caracara plancus      8
168         Flame Crested Tanager             Pitangus sulphuratus      8
169          Green Headed Tanager        Phyllomyias griseocapilla      8
170            Grey Hooded Attila                  Nemosia pileata      8
171           Masked Water Tyrant          Pheugopedius genibarbis      8
172               Moustached Wren              Picumnus temminckii      8
173                  Palm Tanager              Phaethornis pretrei      8
174             Ruddy Ground Dove                  Furnarius rufus      8
175                Rufous Hornero                 Sicalis flaveola      8
176                 Saffron Finch         Buteogallus meridionalis      8
177                 Savannah Hawk                  Thraupis sayaca      8
178             Smooth Billed Ani            Thamnophilus ambiguus      8
179             Southern Antpipit                Troglodytes aedon      8
180           Southern House Wren               Vanellus chilensis      8
181              Southern Lapwing        Stelgidopteryx ruficollis      8
182 Southern Rough Winged Swallow                     Piaya cayana      8
183           Streaked Flycatcher           Myiodynastes maculatus      8
184               Streaked Xenops         Xenops rutilans rutilans      8
185             Tropical Kingbird            Myrmotherula unicolor      8
186           Violaceous Euphonia                    Bubulcus Ibis      8
187          White Barred Piculet                  Manacus manacus      8
188         White Bearded Manakin             Myrmoderus loricatus      8
189         Yellow Backed Tanager         Hemithraupis flavicollis      8
190      Yellow Chinned Spinetail           Certhiaxis cinnamomeus      8
    Pasture X5_to_10 X10_to_15 X15_to_20 secondary
1         2       NA        NA        NA        NA
2         1       NA        NA        NA        NA
3         3       NA        NA        NA        NA
4         2       NA        NA        NA        NA
5        NA       NA        NA         1         2
6         5        2         1         1        NA
7         1       NA        NA        NA        NA
8         1       NA        NA        NA        NA
9         3       NA        NA        NA        NA
10        2       NA        NA        NA        NA
11       NA        1        NA        NA        NA
12       NA       NA        NA         1        NA
13        1       NA        NA        NA        NA
14        2       NA        NA        NA        NA
15       NA        2        NA         2        NA
16       NA       NA        NA        NA         1
17       NA       NA        NA         1        NA
18       14       NA        NA        NA        NA
19        1       NA         1        NA        NA
20       NA        2        NA        NA        NA
21       NA       NA         6        NA        NA
22        1       NA        NA        NA        NA
23       NA       NA        NA         1        NA
24       NA       NA         1        NA        NA
25       NA       NA        NA        NA         1
26       NA       NA        NA        NA         1
27        2       NA        NA        NA        NA
28        2       NA        NA        NA        NA
29        1       NA        NA        NA        NA
30       NA        3        NA        NA        NA
31       NA        3        NA        NA         3
32       NA       NA        NA        NA         3
33       NA       NA        NA        NA         1
34        1       NA        NA        NA        NA
35       NA        1        NA        NA        NA
36       NA        1        NA        NA        NA
37        1       NA        NA        NA        NA
38        2       NA        NA        NA        NA
39        2        1         2        NA        NA
40       NA        1        NA        NA        NA
41       NA        1        NA        NA        NA
42       NA       NA         1        NA        NA
43        1       NA        NA        NA        NA
44       NA       NA        NA         1        NA
45       NA        1        NA        NA        NA
46        1       NA        NA        NA        NA
47       NA        1        NA        NA        NA
48       NA        1        NA        NA        NA
49        3        1        NA        NA        NA
50        1       NA        NA        NA        NA
51        2       NA        NA        NA        NA
52        2       NA        NA        NA        NA
53        1       NA        NA        NA        NA
54        4       NA        NA        NA        NA
55       NA       NA         1        NA        NA
56       NA        1        NA        NA        NA
57        2       NA        NA        NA        NA
58       NA        7        NA        NA        NA
59       NA        1        NA        NA        NA
60       NA        1        NA         1        NA
61        2        1        NA        NA        NA
62       NA       NA        NA         1        NA
63       NA        1        NA        NA        NA
64       NA        1        NA        NA        NA
65        2       NA        NA        NA        NA
66       NA       NA         2        NA        NA
67       NA        2        NA        NA        NA
68        2       NA        NA        NA        NA
69       NA       NA         1        NA        NA
70        2       NA        NA        NA        NA
71       NA        8        NA        NA        NA
72       NA       NA        NA        NA         1
73        1       NA        NA        NA        NA
74        2        1         1        NA         2
75       NA       NA        NA        NA        NA
76       NA       NA        NA        NA         2
77        2       NA        NA        NA        NA
78        1       NA        NA        NA        NA
79        1       NA        NA        NA        NA
80        2       NA        NA        NA        NA
81        2       NA        NA        NA        NA
82        2       NA        NA        NA        NA
83        2       NA        NA        NA        NA
84       NA       NA        NA         1        NA
85       NA       NA        NA        NA         1
86        1       NA        NA        NA        NA
87       NA        1        NA        NA         3
88       NA       NA        NA        NA         1
89       NA       NA        NA        NA         3
90       NA       NA        NA         1        NA
91       NA       NA         1        NA        NA
92       NA       NA        NA         1        NA
93       NA        1        NA        NA        NA
94       NA       NA         1         2        NA
95        1       NA        NA        NA        NA
96        2       NA        NA        NA        NA
97        1       NA        NA        NA        NA
98       NA       NA        NA         1        NA
99       NA       NA         1        NA        NA
100       1       NA        NA        NA        NA
101      NA        2        NA        NA        NA
102      NA       NA        NA         2        NA
103      NA        1        NA        NA         2
104       3       NA        NA        NA        NA
105       2       NA        NA        NA        NA
106      NA       NA        NA        NA         1
107       3       NA        NA        NA        NA
108      NA       NA        NA         1        NA
109       1        1        NA        NA        NA
110      NA        1        NA        NA        NA
111      NA       NA         3        NA        NA
112       1       NA        NA        NA        NA
113      NA       NA        NA         3        NA
114       2       NA        NA        NA        NA
115      NA       NA        NA        NA         3
116      NA       NA        NA        NA         2
117       1       NA        NA        NA        NA
118       1       NA        NA        NA        NA
119       1       NA        NA        NA        NA
120       1       NA        NA        NA        NA
121      NA       NA         1        NA        NA
122      NA       NA        NA         1        NA
123       1       NA        NA        NA        NA
124      NA        1        NA        NA        NA
125       2       NA        NA        NA         1
126       1       NA        NA        NA        NA
127       2       NA        NA        NA        NA
128       2       NA        NA        NA        NA
129       1       NA        NA        NA        NA
130       1       NA        NA        NA        NA
131      NA       NA        NA         1        NA
132       2       NA        NA        NA        NA
133       2       NA        NA        NA        NA
134       2       NA        NA        NA        NA
135      NA       NA        NA        NA         1
136       1       NA        NA        NA        NA
137      NA        1        NA        NA         1
138       1       NA        NA        NA        NA
139      NA       NA        NA         1        NA
140       1       NA        NA        NA        NA
141       1       NA        NA        NA        NA
142       1       NA        NA        NA        NA
143      NA        1        NA        NA        NA
144       1       NA         1        NA        NA
145       1       NA        NA        NA        NA
146       1       NA        NA        NA        NA
147      NA        1        NA        NA        NA
148      NA       NA        NA        NA         7
149       2       NA        NA        NA        NA
150       2       NA        NA        NA        NA
151      NA       NA        NA        NA         2
152       2       NA        NA        NA        NA
153       2       NA        NA        NA        NA
154       1       NA        NA        NA        NA
155      NA        1        NA        NA        NA
156      NA       NA        NA        NA         2
157      NA       NA         2        NA        NA
158       1       NA        NA        NA        NA
159      NA       NA        NA         1        NA
160      NA       NA        NA        NA         1
161      NA       NA        NA         1         1
162       1       NA        NA        NA        NA
163       1       NA        NA        NA        NA
164      NA       NA         1        NA         3
165       1       NA        NA        NA        NA
166       5       NA        NA        NA        NA
167       1       NA        NA        NA        NA
168      NA        1        NA        NA        NA
169       1       NA        NA        NA        NA
170      NA       NA         1        NA        NA
171       1       NA        NA        NA        NA
172      NA       NA        NA        NA         2
173      NA        1         1        NA        NA
174       1       NA        NA        NA        NA
175       1       NA        NA        NA        NA
176       3       NA        NA        NA        NA
177       1       NA        NA        NA        NA
178       2       NA        NA        NA        NA
179      NA       NA        NA         1        NA
180       2       NA        NA        NA        NA
181       2       NA        NA        NA        NA
182       2       NA        NA        NA        NA
183       1       NA        NA        NA        NA
184      NA        1        NA        NA        NA
185       1       NA        NA        NA        NA
186      NA       NA         1        NA        NA
187      NA        1        NA        NA        NA
188      NA        1        NA        NA         1
189      NA        1        NA        NA        NA
190       1       NA        NA        NA        NA
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
josh %>% 
  replace(is.na(.), 0)->josh # replace NA with zero
dim(josh)
[1] 190   8
josh %>% 
  mutate_at(vars(survey), list(factor)) %>% 
  pivot_longer(cols = c(Pasture:secondary)) %>% 
  pivot_wider(names_from = c(name, survey) ,values_from = value ) %>% 
  replace(is.na(.), 0)->data # data on the proper format

Analyses of spcecies similarity

library(vegan)
Carregando pacotes exigidos: permute
Carregando pacotes exigidos: lattice
This is vegan 2.6-4
t(data[-c(1,2)])->data2# leave only what is needed for analyses
colnames(data)
 [1] "common.name" "latin.name"  "Pasture_1"   "X5_to_10_1"  "X10_to_15_1"
 [6] "X15_to_20_1" "secondary_1" "Pasture_2"   "X5_to_10_2"  "X10_to_15_2"
[11] "X15_to_20_2" "secondary_2" "Pasture_3"   "X5_to_10_3"  "X10_to_15_3"
[16] "X15_to_20_3" "secondary_3" "Pasture_4"   "X5_to_10_4"  "X10_to_15_4"
[21] "X15_to_20_4" "secondary_4" "Pasture_5"   "X5_to_10_5"  "X10_to_15_5"
[26] "X15_to_20_5" "secondary_5" "Pasture_6"   "X5_to_10_6"  "X10_to_15_6"
[31] "X15_to_20_6" "secondary_6" "Pasture_7"   "X5_to_10_7"  "X10_to_15_7"
[36] "X15_to_20_7" "secondary_7" "Pasture_8"   "X5_to_10_8"  "X10_to_15_8"
[41] "X15_to_20_8" "secondary_8"
dim(data2)# correct! 69 species detected in 40 samples (8 surveys x 5 sites)
[1] 40 68
vegdist(data2)
Warning in vegdist(data2): you have empty rows: their dissimilarities may be
                 meaningless in method "bray"
            Pasture_1 X5_to_10_1 X10_to_15_1 X15_to_20_1 secondary_1 Pasture_2
X5_to_10_1  0.8571429                                                         
X10_to_15_1 0.9166667  0.6666667                                              
X15_to_20_1 0.9285714  0.4000000   0.6666667                                  
secondary_1 1.0000000  1.0000000   1.0000000   0.7500000                      
Pasture_2   0.8222222  1.0000000   1.0000000   1.0000000   1.0000000          
X5_to_10_2  1.0000000  0.5384615   1.0000000   0.5384615   0.6363636 1.0000000
X10_to_15_2 0.9354839  1.0000000   1.0000000   1.0000000   1.0000000 0.9333333
X15_to_20_2 1.0000000  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000
secondary_2 0.9375000  0.5714286   0.8000000   0.5714286   1.0000000 1.0000000
Pasture_3   0.4042553  0.8620690   0.9200000   0.9310345   1.0000000 0.6956522
X5_to_10_3  0.9069767  0.8400000   0.9047619   0.7600000   0.9130435 0.9047619
X10_to_15_3 0.8518519  1.0000000   1.0000000   0.7777778   1.0000000 0.9230769
X15_to_20_3 1.0000000  0.7142857   1.0000000   0.7142857   1.0000000 1.0000000
secondary_3 1.0000000  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000
Pasture_4   0.5111111  0.8518519   0.9130435   0.8518519   0.8400000 0.9090909
X5_to_10_4  0.8378378  0.7894737   0.8666667   0.7894737   1.0000000 0.9444444
X10_to_15_4 0.9285714  0.8000000   0.6666667   0.8000000   1.0000000 0.9259259
X15_to_20_4 1.0000000  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000
secondary_4 0.8888889  0.5555556   0.8571429   0.6666667   1.0000000 1.0000000
Pasture_5   0.6666667  1.0000000   1.0000000   0.9166667   0.8181818 0.7560976
X5_to_10_5  0.9310345  0.8181818   0.7142857   0.8181818   1.0000000 1.0000000
X10_to_15_5 1.0000000  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000
X15_to_20_5 1.0000000  1.0000000   1.0000000   0.8666667   1.0000000 1.0000000
secondary_5 0.8709677  0.3846154   0.7777778   0.5384615   1.0000000 1.0000000
Pasture_6   0.4883721  0.8400000   0.9047619   0.9200000   1.0000000 0.7619048
X5_to_10_6  1.0000000  0.7142857   1.0000000   0.7142857   1.0000000 1.0000000
X10_to_15_6 1.0000000  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000
X15_to_20_6 1.0000000  1.0000000   1.0000000   0.7142857   1.0000000 1.0000000
secondary_6 0.9230769  0.5000000   0.5000000   0.5000000   1.0000000 1.0000000
Pasture_7   0.5384615  1.0000000   1.0000000   0.9047619   0.8947368 0.6842105
X5_to_10_7  1.0000000  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000
X10_to_15_7 0.9230769  1.0000000   1.0000000   1.0000000   1.0000000 0.9200000
X15_to_20_7 1.0000000  0.7500000   1.0000000   0.7500000   1.0000000 1.0000000
secondary_7 0.7222222  0.6666667   0.8571429   0.7777778   1.0000000 1.0000000
Pasture_8   0.6078431  1.0000000   1.0000000   0.9393939   0.9354839 0.6400000
X5_to_10_8  1.0000000  0.8181818   1.0000000   0.8181818   1.0000000 1.0000000
X10_to_15_8 1.0000000  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000
X15_to_20_8 1.0000000  1.0000000   1.0000000   0.6666667   1.0000000 1.0000000
secondary_8 1.0000000  0.8181818   1.0000000   0.8181818   1.0000000 1.0000000
            X5_to_10_2 X10_to_15_2 X15_to_20_2 secondary_2 Pasture_3 X5_to_10_3
X5_to_10_1                                                                     
X10_to_15_1                                                                    
X15_to_20_1                                                                    
secondary_1                                                                    
Pasture_2                                                                      
X5_to_10_2                                                                     
X10_to_15_2  1.0000000                                                         
X15_to_20_2  1.0000000   1.0000000                                             
secondary_2  0.6470588   1.0000000   1.0000000                                 
Pasture_3    1.0000000   0.9375000   1.0000000   0.9393939                     
X5_to_10_3   0.8571429   0.9285714   0.9090909   0.8620690 0.8636364           
X10_to_15_3  1.0000000   0.8333333   1.0000000   1.0000000 0.8571429  0.9166667
X15_to_20_3  0.8000000   1.0000000   1.0000000   0.8181818 1.0000000  0.9090909
secondary_3  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
Pasture_4    0.8666667   1.0000000   1.0000000   0.9354839 0.5217391  0.9047619
X5_to_10_4   0.9090909   0.3636364   1.0000000   0.8260870 0.8421053  0.7647059
X10_to_15_4  1.0000000   1.0000000   1.0000000   0.8571429 0.8620690  0.8400000
X15_to_20_4  1.0000000   1.0000000   0.6000000   0.8333333 1.0000000  1.0000000
secondary_4  0.7142857   1.0000000   1.0000000   0.3636364 0.8918919  0.8787879
Pasture_5    0.8518519   1.0000000   1.0000000   1.0000000 0.4883721  0.7948718
X5_to_10_5   1.0000000   1.0000000   1.0000000   0.8666667 0.8666667  0.8461538
X10_to_15_5  1.0000000   0.8461538   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_5  1.0000000   1.0000000   0.8333333   1.0000000 1.0000000  1.0000000
secondary_5  0.6250000   1.0000000   1.0000000   0.5294118 0.8750000  0.8571429
Pasture_6    1.0000000   1.0000000   1.0000000   0.9310345 0.4090909  0.9000000
X5_to_10_6   0.8000000   1.0000000   1.0000000   0.8181818 1.0000000  0.9090909
X10_to_15_6  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_6  1.0000000   1.0000000   0.5000000   1.0000000 1.0000000  0.9090909
secondary_6  0.8181818   1.0000000   1.0000000   0.6666667 0.9259259  0.8260870
Pasture_7    0.9166667   0.9166667   1.0000000   1.0000000 0.5500000  0.8888889
X5_to_10_7   1.0000000   1.0000000   1.0000000   1.0000000 1.0000000  0.8260870
X10_to_15_7  1.0000000   0.8181818   1.0000000   1.0000000 0.9259259  0.9130435
X15_to_20_7  0.8181818   1.0000000   0.6000000   0.8333333 1.0000000  0.9130435
secondary_7  0.9047619   1.0000000   1.0000000   0.8181818 0.8378378  0.8787879
Pasture_8    0.9444444   1.0000000   1.0000000   1.0000000 0.6153846  0.9583333
X5_to_10_8   0.8571429   1.0000000   1.0000000   0.8666667 1.0000000  0.7692308
X10_to_15_8  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000  0.8333333
X15_to_20_8  1.0000000   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
secondary_8  0.8571429   1.0000000   1.0000000   0.8666667 1.0000000  0.9230769
            X10_to_15_3 X15_to_20_3 secondary_3 Pasture_4 X5_to_10_4
X5_to_10_1                                                          
X10_to_15_1                                                         
X15_to_20_1                                                         
secondary_1                                                         
Pasture_2                                                           
X5_to_10_2                                                          
X10_to_15_2                                                         
X15_to_20_2                                                         
secondary_2                                                         
Pasture_3                                                           
X5_to_10_3                                                          
X10_to_15_3                                                         
X15_to_20_3   1.0000000                                             
secondary_3   1.0000000   1.0000000                                 
Pasture_4     1.0000000   1.0000000   1.0000000                     
X5_to_10_4    0.7777778   0.8750000   1.0000000 0.9444444           
X10_to_15_4   0.7777778   1.0000000   1.0000000 0.9259259  0.8947368
X15_to_20_4   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
secondary_4   1.0000000   0.7333333   1.0000000 0.8857143  0.8518519
Pasture_5     1.0000000   1.0000000   1.0000000 0.5609756  1.0000000
X5_to_10_5    1.0000000   1.0000000   1.0000000 0.7857143  0.8000000
X10_to_15_5   1.0000000   1.0000000   1.0000000 1.0000000  0.8947368
X15_to_20_5   0.8571429   1.0000000   1.0000000 1.0000000  1.0000000
secondary_5   1.0000000   0.8000000   1.0000000 0.8666667  0.8181818
Pasture_6     1.0000000   1.0000000   1.0000000 0.4761905  0.9411765
X5_to_10_6    1.0000000   0.5000000   1.0000000 1.0000000  0.8750000
X10_to_15_6   0.6000000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_6   0.6666667   1.0000000   1.0000000 1.0000000  1.0000000
secondary_6   1.0000000   0.6000000   1.0000000 0.9200000  0.7647059
Pasture_7     0.9000000   1.0000000   1.0000000 0.5789474  0.8666667
X5_to_10_7    1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
X10_to_15_7   0.7142857   1.0000000   1.0000000 1.0000000  0.8823529
X15_to_20_7   1.0000000   0.6000000   1.0000000 1.0000000  0.8823529
secondary_7   1.0000000   0.8666667   1.0000000 0.8857143  0.8518519
Pasture_8     1.0000000   1.0000000   1.0000000 0.5600000  0.9523810
X5_to_10_8    1.0000000   0.7500000   1.0000000 1.0000000  0.9000000
X10_to_15_8   0.7500000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_8   0.6000000   1.0000000   1.0000000 1.0000000  1.0000000
secondary_8   1.0000000   0.7500000   1.0000000 1.0000000  0.9000000
            X10_to_15_4 X15_to_20_4 secondary_4 Pasture_5 X5_to_10_5
X5_to_10_1                                                          
X10_to_15_1                                                         
X15_to_20_1                                                         
secondary_1                                                         
Pasture_2                                                           
X5_to_10_2                                                          
X10_to_15_2                                                         
X15_to_20_2                                                         
secondary_2                                                         
Pasture_3                                                           
X5_to_10_3                                                          
X10_to_15_3                                                         
X15_to_20_3                                                         
secondary_3                                                         
Pasture_4                                                           
X5_to_10_4                                                          
X10_to_15_4                                                         
X15_to_20_4   1.0000000                                             
secondary_4   0.8888889   1.0000000                                 
Pasture_5     0.9166667   1.0000000   1.0000000                     
X5_to_10_5    0.8181818   1.0000000   0.8947368 0.9200000           
X10_to_15_5   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_5   1.0000000   0.8461538   1.0000000 1.0000000  1.0000000
secondary_5   0.8461538   1.0000000   0.5238095 1.0000000  0.8571429
Pasture_6     0.8400000   1.0000000   0.8787879 0.5897436  0.8461538
X5_to_10_6    1.0000000   1.0000000   0.8666667 1.0000000  1.0000000
X10_to_15_6   0.6666667   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_6   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
secondary_6   0.7500000   1.0000000   0.6250000 1.0000000  0.7777778
Pasture_7     1.0000000   1.0000000   1.0000000 0.4285714  0.8181818
X5_to_10_7    1.0000000   1.0000000   1.0000000 1.0000000  0.7777778
X10_to_15_7   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_7   1.0000000   0.6666667   0.8750000 1.0000000  1.0000000
secondary_7   0.8888889   1.0000000   0.6923077 1.0000000  0.8947368
Pasture_8     1.0000000   1.0000000   1.0000000 0.5744681  0.8823529
X5_to_10_8    1.0000000   1.0000000   0.8947368 1.0000000  0.8333333
X10_to_15_8   0.7777778   1.0000000   1.0000000 0.9130435  1.0000000
X15_to_20_8   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
secondary_8   1.0000000   1.0000000   0.8947368 1.0000000  1.0000000
            X10_to_15_5 X15_to_20_5 secondary_5 Pasture_6 X5_to_10_6
X5_to_10_1                                                          
X10_to_15_1                                                         
X15_to_20_1                                                         
secondary_1                                                         
Pasture_2                                                           
X5_to_10_2                                                          
X10_to_15_2                                                         
X15_to_20_2                                                         
secondary_2                                                         
Pasture_3                                                           
X5_to_10_3                                                          
X10_to_15_3                                                         
X15_to_20_3                                                         
secondary_3                                                         
Pasture_4                                                           
X5_to_10_4                                                          
X10_to_15_4                                                         
X15_to_20_4                                                         
secondary_4                                                         
Pasture_5                                                           
X5_to_10_5                                                          
X10_to_15_5                                                         
X15_to_20_5   0.8666667                                             
secondary_5   1.0000000   1.0000000                                 
Pasture_6     1.0000000   1.0000000   0.8571429                     
X5_to_10_6    1.0000000   0.8333333   0.8000000 1.0000000           
X10_to_15_6   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_6   1.0000000   0.8333333   1.0000000 1.0000000  1.0000000
secondary_6   1.0000000   1.0000000   0.6363636 0.9130435  0.6000000
Pasture_7     1.0000000   1.0000000   1.0000000 0.5000000  1.0000000
X5_to_10_7    1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
X10_to_15_7   0.5000000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_7   1.0000000   0.6923077   0.8181818 1.0000000  0.6000000
secondary_7   1.0000000   1.0000000   0.6190476 0.8787879  0.8666667
Pasture_8     1.0000000   1.0000000   1.0000000 0.5000000  1.0000000
X5_to_10_8    1.0000000   1.0000000   0.7142857 1.0000000  0.7500000
X10_to_15_8   0.7777778   0.8571429   1.0000000 1.0000000  1.0000000
X15_to_20_8   1.0000000   0.8181818   1.0000000 1.0000000  1.0000000
secondary_8   0.8181818   0.7500000   0.8571429 1.0000000  0.7500000
            X10_to_15_6 X15_to_20_6 secondary_6 Pasture_7 X5_to_10_7
X5_to_10_1                                                          
X10_to_15_1                                                         
X15_to_20_1                                                         
secondary_1                                                         
Pasture_2                                                           
X5_to_10_2                                                          
X10_to_15_2                                                         
X15_to_20_2                                                         
secondary_2                                                         
Pasture_3                                                           
X5_to_10_3                                                          
X10_to_15_3                                                         
X15_to_20_3                                                         
secondary_3                                                         
Pasture_4                                                           
X5_to_10_4                                                          
X10_to_15_4                                                         
X15_to_20_4                                                         
secondary_4                                                         
Pasture_5                                                           
X5_to_10_5                                                          
X10_to_15_5                                                         
X15_to_20_5                                                         
secondary_5                                                         
Pasture_6                                                           
X5_to_10_6                                                          
X10_to_15_6                                                         
X15_to_20_6   1.0000000                                             
secondary_6   1.0000000   1.0000000                                 
Pasture_7     1.0000000   1.0000000   1.0000000                     
X5_to_10_7    1.0000000   1.0000000   1.0000000 1.0000000           
X10_to_15_7   1.0000000   1.0000000   1.0000000 0.8947368  1.0000000
X15_to_20_7   1.0000000   1.0000000   0.6666667 1.0000000  1.0000000
secondary_7   1.0000000   1.0000000   0.6250000 1.0000000  1.0000000
Pasture_8     1.0000000   1.0000000   1.0000000 0.4090909  1.0000000
X5_to_10_8    1.0000000   1.0000000   0.7777778 1.0000000  0.5555556
X10_to_15_8   0.6000000   1.0000000   1.0000000 1.0000000  1.0000000
X15_to_20_8   1.0000000   0.3333333   1.0000000 1.0000000  1.0000000
secondary_8   1.0000000   1.0000000   0.7777778 1.0000000  1.0000000
            X10_to_15_7 X15_to_20_7 secondary_7 Pasture_8 X5_to_10_8
X5_to_10_1                                                          
X10_to_15_1                                                         
X15_to_20_1                                                         
secondary_1                                                         
Pasture_2                                                           
X5_to_10_2                                                          
X10_to_15_2                                                         
X15_to_20_2                                                         
secondary_2                                                         
Pasture_3                                                           
X5_to_10_3                                                          
X10_to_15_3                                                         
X15_to_20_3                                                         
secondary_3                                                         
Pasture_4                                                           
X5_to_10_4                                                          
X10_to_15_4                                                         
X15_to_20_4                                                         
secondary_4                                                         
Pasture_5                                                           
X5_to_10_5                                                          
X10_to_15_5                                                         
X15_to_20_5                                                         
secondary_5                                                         
Pasture_6                                                           
X5_to_10_6                                                          
X10_to_15_6                                                         
X15_to_20_6                                                         
secondary_6                                                         
Pasture_7                                                           
X5_to_10_7                                                          
X10_to_15_7                                                         
X15_to_20_7   1.0000000                                             
secondary_7   1.0000000   0.8750000                                 
Pasture_8     1.0000000   1.0000000   1.0000000                     
X5_to_10_8    1.0000000   0.7777778   0.8947368 1.0000000           
X10_to_15_8   1.0000000   1.0000000   1.0000000 1.0000000  0.8000000
X15_to_20_8   1.0000000   1.0000000   1.0000000 1.0000000  1.0000000
secondary_8   1.0000000   0.7777778   0.8947368 1.0000000  0.8333333
            X10_to_15_8 X15_to_20_8
X5_to_10_1                         
X10_to_15_1                        
X15_to_20_1                        
secondary_1                        
Pasture_2                          
X5_to_10_2                         
X10_to_15_2                        
X15_to_20_2                        
secondary_2                        
Pasture_3                          
X5_to_10_3                         
X10_to_15_3                        
X15_to_20_3                        
secondary_3                        
Pasture_4                          
X5_to_10_4                         
X10_to_15_4                        
X15_to_20_4                        
secondary_4                        
Pasture_5                          
X5_to_10_5                         
X10_to_15_5                        
X15_to_20_5                        
secondary_5                        
Pasture_6                          
X5_to_10_6                         
X10_to_15_6                        
X15_to_20_6                        
secondary_6                        
Pasture_7                          
X5_to_10_7                         
X10_to_15_7                        
X15_to_20_7                        
secondary_7                        
Pasture_8                          
X5_to_10_8                         
X10_to_15_8                        
X15_to_20_8   1.0000000            
secondary_8   0.8000000   1.0000000
nmds <- metaMDS(data2,distance="euclidean")
Wisconsin double standardization
Run 0 stress 0.2037856 
Run 1 stress 0.2266804 
Run 2 stress 0.2338075 
Run 3 stress 0.2194951 
Run 4 stress 0.2209862 
Run 5 stress 0.2439045 
Run 6 stress 0.2172372 
Run 7 stress 0.2141376 
Run 8 stress 0.2188263 
Run 9 stress 0.2191668 
Run 10 stress 0.2265656 
Run 11 stress 0.2243587 
Run 12 stress 0.2116915 
Run 13 stress 0.2279345 
Run 14 stress 0.2269473 
Run 15 stress 0.2313409 
Run 16 stress 0.2317437 
Run 17 stress 0.2217217 
Run 18 stress 0.2216542 
Run 19 stress 0.2052639 
Run 20 stress 0.2189563 
*** Best solution was not repeated -- monoMDS stopping criteria:
     3: no. of iterations >= maxit
    17: stress ratio > sratmax
nmds$points # coordinates of each sample effort
                    MDS1         MDS2
Pasture_1   -0.020657668  0.017533208
X5_to_10_1  -0.165301629 -0.120707627
X10_to_15_1 -0.715819798  0.127412010
X15_to_20_1  0.103888000 -0.074984455
secondary_1 -0.261596107  0.211590665
Pasture_2    0.013695939  0.035022325
X5_to_10_2  -0.112945216 -0.116795658
X10_to_15_2 -0.086843939  0.235244682
X15_to_20_2  0.232492590 -0.210992485
secondary_2 -0.057837854 -0.073921125
Pasture_3   -0.012508029  0.015956212
X5_to_10_3   0.002592479  0.012074803
X10_to_15_3  0.192132817  0.046565304
X15_to_20_3 -0.259641714 -0.347646998
secondary_3 -0.004150172  0.003997881
Pasture_4   -0.019338790  0.015060012
X5_to_10_4  -0.080270129  0.051424550
X10_to_15_4  0.154261748  0.117254608
X15_to_20_4  0.085909983 -0.151562446
secondary_4 -0.058593778 -0.034179862
Pasture_5   -0.005879959  0.014429873
X5_to_10_5  -0.064863494  0.099862718
X10_to_15_5  0.034154937  0.362388164
X15_to_20_5  0.060068619 -0.043676251
secondary_5 -0.135961759 -0.058323340
Pasture_6   -0.012890341  0.011780295
X5_to_10_6  -0.114088427 -0.309771682
X10_to_15_6  0.623128052  0.325953223
X15_to_20_6  0.308484932 -0.082472553
secondary_6 -0.313543828 -0.099231732
Pasture_7   -0.010846379  0.018025058
X5_to_10_7  -0.006327036  0.170663830
X10_to_15_7  0.038234827  0.386040591
X15_to_20_7  0.095056386 -0.248225925
secondary_7 -0.132818447  0.007869493
Pasture_8   -0.008301412  0.012245268
X5_to_10_8  -0.028183378  0.063407518
X10_to_15_8  0.125741952  0.106657107
X15_to_20_8  0.640204688 -0.274082191
secondary_8 -0.020838666 -0.221885065
attr(,"centre")
[1] TRUE
attr(,"pc")
[1] TRUE
attr(,"halfchange")
[1] FALSE
attr(,"internalscaling")
[1] 3.631763
coord_nmds<-nmds$points
coord_nmds<-as.data.frame(coord_nmds)
dim(coord_nmds)
[1] 40  2
coord_nmds$habitat<-rep(c("pas","5-10","10-15","15-20","sec"),8)

coord_nmds %>% 
  ggplot(aes(MDS1,MDS2, color=habitat))+
  geom_point(size = 3)+
  stat_ellipse()+theme_bw()+xlab("NMDS1")+ylab("NMDS2")+ggtitle("NMDS of bird communities")+ theme(plot.title = element_text(hjust = 0.5))
Warning in MASS::cov.trob(data[, vars]): Probable convergence failure

anosim(data2, distance = "euclidean", grouping = coord_nmds$habitat) # There is a significant diffrerence in species composition

Call:
anosim(x = data2, grouping = coord_nmds$habitat, distance = "euclidean") 
Dissimilarity: euclidean 

ANOSIM statistic R: 0.2043 
      Significance: 0.001 

Permutation: free
Number of permutations: 999