bio<-read.table("cwmbent.txt",header=T)
nrow(bio);ncol(bio);names(bio)
## [1] 45
## [1] 29
##  [1] "Mobile"                                              
##  [2] "s_Mobile"                                            
##  [3] "S_Sessile_Tube"                                      
##  [4] "Sessile"                                             
##  [5] "Deposi_Detriti"                                      
##  [6] "Susp_Filtr"                                          
##  [7] "Scavenger_Opport"                                    
##  [8] "Herbivore"                                           
##  [9] "Predator_Carni"                                      
## [10] "Builder_Tube"                                        
## [11] "Burrowing"                                           
## [12] "Outhers.free_living_in_matriz_sediment.superficials."
## [13] "Epifauna"                                            
## [14] "Superficial"                                         
## [15] "Conveyors"                                           
## [16] "Biodiffusors_Gallery"                                
## [17] "Size_1"                                              
## [18] "Size_1_3"                                            
## [19] "Size_3_5"                                            
## [20] "Size_5"                                              
## [21] "LS_Short"                                            
## [22] "LS_Medium"                                           
## [23] "LS_Long"                                             
## [24] "LS_Very_long"                                        
## [25] "Plank"                                               
## [26] "Lec"                                                 
## [27] "Dir"                                                 
## [28] "Praia"                                               
## [29] "Praias"
biot<-bio[1:45,1:27]
result<-rda(biot,abiot)
summary(result)
## 
## Call:
## rda(X = biot, Y = abiot) 
## 
## Partitioning of variance:
##               Inertia Proportion
## Total          0.4524     1.0000
## Constrained    0.2339     0.5171
## Unconstrained  0.2185     0.4829
## 
## Eigenvalues, and their contribution to the variance 
## 
## Importance of components:
##                         RDA1    RDA2    RDA3     RDA4     RDA5     RDA6
## Eigenvalue            0.1448 0.05685 0.01620 0.006178 0.004681 0.002677
## Proportion Explained  0.3202 0.12567 0.03581 0.013656 0.010347 0.005916
## Cumulative Proportion 0.3202 0.44585 0.48166 0.495315 0.505662 0.511579
##                           RDA7      RDA8     PC1     PC2     PC3     PC4
## Eigenvalue            0.002110 0.0003767 0.07881 0.03506 0.02571 0.01904
## Proportion Explained  0.004665 0.0008328 0.17422 0.07750 0.05684 0.04208
## Cumulative Proportion 0.516243 0.5170761 0.69129 0.76880 0.82564 0.86772
##                           PC5     PC6      PC7      PC8      PC9     PC10
## Eigenvalue            0.01481 0.01124 0.008018 0.006778 0.005334 0.003036
## Proportion Explained  0.03274 0.02486 0.017725 0.014982 0.011790 0.006712
## Cumulative Proportion 0.90046 0.92531 0.943039 0.958021 0.969811 0.976523
##                           PC11     PC12    PC13     PC14      PC15      PC16
## Eigenvalue            0.002669 0.002253 0.00166 0.001201 0.0009696 0.0007747
## Proportion Explained  0.005901 0.004980 0.00367 0.002655 0.0021433 0.0017125
## Cumulative Proportion 0.982424 0.987404 0.99107 0.993729 0.9958719 0.9975844
##                            PC17      PC18      PC19      PC20      PC21
## Eigenvalue            0.0004572 0.0003847 0.0001332 8.018e-05 3.144e-05
## Proportion Explained  0.0010106 0.0008504 0.0002944 1.772e-04 6.950e-05
## Cumulative Proportion 0.9985951 0.9994454 0.9997398 9.999e-01 1.000e+00
##                            PC22      PC23      PC24
## Eigenvalue            3.321e-06 2.693e-06 7.659e-08
## Proportion Explained  7.342e-06 5.953e-06 1.693e-07
## Cumulative Proportion 1.000e+00 1.000e+00 1.000e+00
## 
## Accumulated constrained eigenvalues
## Importance of components:
##                         RDA1    RDA2    RDA3     RDA4     RDA5     RDA6
## Eigenvalue            0.1448 0.05685 0.01620 0.006178 0.004681 0.002677
## Proportion Explained  0.6192 0.24304 0.06925 0.026409 0.020011 0.011442
## Cumulative Proportion 0.6192 0.86225 0.93151 0.957915 0.977926 0.989368
##                           RDA7      RDA8
## Eigenvalue            0.002110 0.0003767
## Proportion Explained  0.009021 0.0016106
## Cumulative Proportion 0.998389 1.0000000
## 
## Scaling 2 for species and site scores
## * Species are scaled proportional to eigenvalues
## * Sites are unscaled: weighted dispersion equal on all dimensions
## * General scaling constant of scores:  2.11222 
## 
## 
## Species scores
## 
##                                                          RDA1       RDA2
## Mobile                                               -0.47791  0.1611791
## s_Mobile                                              0.30157 -0.0563788
## S_Sessile_Tube                                        0.12231 -0.0093129
## Sessile                                               0.04793 -0.0809970
## Deposi_Detriti                                        0.31732  0.0109460
## Susp_Filtr                                            0.12937 -0.1227082
## Scavenger_Opport                                      0.02392 -0.0266062
## Herbivore                                            -0.60865  0.0613298
## Predator_Carni                                        0.14133  0.0739577
## Builder_Tube                                          0.07201  0.0958005
## Burrowing                                             0.05817 -0.3586663
## Outhers.free_living_in_matriz_sediment.superficials. -0.13017  0.2628658
## Epifauna                                              0.06215 -0.1021692
## Superficial                                          -0.11304  0.2949072
## Conveyors                                             0.07315 -0.0002617
## Biodiffusors_Gallery                                 -0.02255 -0.1927788
## Size_1                                               -0.08876  0.0738848
## Size_1_3                                             -0.18937 -0.0229287
## Size_3_5                                              0.01748 -0.1498142
## Size_5                                                0.26065  0.0988581
## LS_Short                                              0.19056  0.1300088
## LS_Medium                                            -0.11100  0.0451269
## LS_Long                                              -0.08530 -0.1349843
## LS_Very_long                                          0.02287 -0.0260826
## Plank                                                -0.49440 -0.2284135
## Lec                                                   0.22756  0.0685167
## Dir                                                   0.26610  0.1592319
##                                                           RDA3      RDA4
## Mobile                                                0.027527  0.063918
## s_Mobile                                              0.117330 -0.063587
## S_Sessile_Tube                                       -0.119374 -0.001185
## Sessile                                              -0.022553  0.004888
## Deposi_Detriti                                        0.016004  0.024612
## Susp_Filtr                                           -0.124077 -0.018421
## Scavenger_Opport                                      0.016787 -0.007058
## Herbivore                                             0.012652  0.021208
## Predator_Carni                                        0.086267 -0.019103
## Builder_Tube                                         -0.127904  0.025824
## Burrowing                                             0.133756 -0.024708
## Outhers.free_living_in_matriz_sediment.superficials. -0.005852 -0.001115
## Epifauna                                             -0.051531 -0.053673
## Superficial                                           0.088953 -0.100097
## Conveyors                                            -0.075824  0.019289
## Biodiffusors_Gallery                                  0.037820  0.134794
## Size_1                                               -0.023483 -0.028988
## Size_1_3                                              0.044025  0.012852
## Size_3_5                                             -0.022475  0.050114
## Size_5                                                0.001932 -0.033978
## LS_Short                                             -0.126344  0.011426
## LS_Medium                                             0.127196  0.045683
## LS_Long                                               0.045924 -0.034652
## LS_Very_long                                         -0.045022  0.012497
## Plank                                                -0.094851 -0.081525
## Lec                                                   0.080016  0.036354
## Dir                                                   0.015184  0.045015
##                                                            RDA5      RDA6
## Mobile                                                0.0324393 -0.025047
## s_Mobile                                              0.0217685 -0.036198
## S_Sessile_Tube                                       -0.0510055  0.030372
## Sessile                                              -0.0034409  0.024944
## Deposi_Detriti                                       -0.0357567 -0.022095
## Susp_Filtr                                            0.0520745  0.038002
## Scavenger_Opport                                      0.0009717 -0.012640
## Herbivore                                            -0.0383294 -0.024678
## Predator_Carni                                        0.0289027  0.019099
## Builder_Tube                                         -0.0205426  0.026835
## Burrowing                                            -0.0306828 -0.025135
## Outhers.free_living_in_matriz_sediment.superficials.  0.0512254 -0.001700
## Epifauna                                             -0.0451257  0.004685
## Superficial                                          -0.0019357  0.012708
## Conveyors                                            -0.0090340  0.008597
## Biodiffusors_Gallery                                  0.0562381 -0.026282
## Size_1                                                0.0336056 -0.006095
## Size_1_3                                             -0.1138851  0.008049
## Size_3_5                                              0.0244895  0.021234
## Size_5                                                0.0557900 -0.023187
## LS_Short                                             -0.0599100 -0.079954
## LS_Medium                                            -0.0264334  0.070056
## LS_Long                                               0.0114099  0.040896
## LS_Very_long                                          0.0572790 -0.009500
## Plank                                                 0.0247554 -0.013255
## Lec                                                  -0.0148852 -0.032991
## Dir                                                  -0.0105993  0.046123
## 
## 
## Site scores (weighted sums of species scores)
## 
##         RDA1      RDA2     RDA3     RDA4     RDA5     RDA6
## SA1 -0.58181  0.288116 -0.20900 -1.24642  0.46019  1.03273
## SA2 -0.78457  0.357006 -0.13093 -0.51518  0.35924  0.93345
## SA3 -0.25533 -0.108131  0.44221  0.42182 -0.34189  0.24181
## SA4 -0.07958 -0.266880  0.44517  1.74182 -0.19821 -0.69147
## SA5 -0.30903  0.189964  0.33249  0.69122  0.21450  0.28429
## SB1 -0.59619  0.001105  0.22156  0.37528  0.23073 -0.19583
## SB2 -0.53052  0.296197  0.03606  0.05255  0.09902  0.04839
## SB3 -0.42896 -0.018916  0.22858  0.61467 -0.08742 -0.63615
## SB4  0.13026 -0.042374  0.55190  0.28235  0.18200  0.22990
## SB5 -0.38896 -0.133569  0.23733  0.99305 -0.14949 -0.54492
## SC1 -0.32671  0.388205 -0.47446 -0.46125 -0.33056 -0.22840
## SC2 -0.03560 -0.160411 -0.24504  0.31487 -0.01455 -0.84571
## SC3 -0.66366  0.408046 -0.35695 -0.70102 -0.43306  1.68065
## SC4 -0.62253  0.113502 -0.12313 -0.49712  0.45123 -0.79722
## SC5  0.42906  0.314294 -1.38948  0.83859 -2.62747  0.99209
## CA1  0.40440  0.187983  0.76910 -0.97690 -0.19306 -0.75583
## CA2  0.35229  0.154074  0.54248 -0.27893  0.12831 -0.31300
## CA3  0.19230  0.394234  0.45924 -0.25473 -0.57122  0.55950
## CA4  0.18637  0.464125  1.04346 -0.05562  0.27588  1.60370
## CA5  0.32476  0.324497  0.12132 -0.01648 -0.35947  0.37452
## CB1  0.35215  0.311088 -0.09075  0.23747  0.34549 -0.61291
## CB2  0.42542  0.434464 -0.29341  0.42840  0.16218 -1.88997
## CB3  0.41108  0.401987  0.19306 -0.05802 -0.61872 -0.13464
## CB4  0.39278  0.334953 -0.33394  0.04780 -0.39862 -0.59044
## CB5  0.28801  0.092065  0.32146 -0.31247 -0.22147  0.40381
## CC1  0.23895 -0.022959 -0.72892  0.31985  0.18777  0.76058
## CC2  0.24279  0.372356 -0.12727  0.06701  1.06274  0.30192
## CC3  0.29626  0.311308 -0.48061  0.18134  0.81881  0.78517
## CC4  0.33027  0.420876 -0.38196  0.18819  0.42763 -0.39123
## CC5  0.30359  0.172304 -0.28807  0.13386  0.47040 -0.47795
## TA1  0.27820 -0.565556  0.58091  0.89731 -0.08494 -1.50707
## TA2  0.20102 -0.464302 -0.88520 -0.73577 -0.14279  1.25086
## TA3  0.28616 -0.459254  0.33097  1.18644  0.15723  0.49661
## TA4  0.24973 -0.508291 -0.01564 -0.90330 -0.22328  0.11757
## TA5  0.22311 -0.839186  0.33399  1.06735 -0.76034 -0.86862
## TB1  0.21382 -0.470692  0.22952 -0.36846 -0.18975  0.79333
## TB2  0.29094 -0.446662  0.33497 -0.14811 -0.19020 -0.83809
## TB3  0.09559 -0.504449 -0.77570  0.32812  0.64237  0.99337
## TB4  0.18940 -0.336548 -0.23951 -0.36313  0.05047  0.35721
## TB5  0.13822 -0.705251 -0.17976 -0.61418 -0.08610  0.07039
## TC1 -0.10566 -0.323569  0.29305 -0.97370  0.23384 -0.71343
## TC2 -0.58210  0.049565  0.25329 -0.22123  0.21329 -0.40966
## TC3 -0.23983 -0.492534 -0.37937  0.26773  0.62301 -1.57793
## TC4 -0.31489 -0.146660  0.05926 -0.85178  0.05965  0.01698
## TC5 -0.62098  0.233880 -0.23229 -1.12329  0.36664  0.69164
## 
## 
## Site constraints (linear combinations of constraining variables)
## 
##        RDA1     RDA2     RDA3     RDA4     RDA5    RDA6
## SA1 -0.4021  0.09201  0.17599  0.21865  0.09877  0.3602
## SA2 -0.4021  0.09201  0.17599  0.21865  0.09877  0.3602
## SA3 -0.4021  0.09201  0.17599  0.21865  0.09877  0.3602
## SA4 -0.4021  0.09201  0.17599  0.21865  0.09877  0.3602
## SA5 -0.4021  0.09201  0.17599  0.21865  0.09877  0.3602
## SB1 -0.3629  0.02049  0.25509  0.46358  0.05497 -0.2197
## SB2 -0.3629  0.02049  0.25509  0.46358  0.05497 -0.2197
## SB3 -0.3629  0.02049  0.25509  0.46358  0.05497 -0.2197
## SB4 -0.3629  0.02049  0.25509  0.46358  0.05497 -0.2197
## SB5 -0.3629  0.02049  0.25509  0.46358  0.05497 -0.2197
## SC1 -0.2439  0.21273 -0.51781 -0.10119 -0.59088  0.1603
## SC2 -0.2439  0.21273 -0.51781 -0.10119 -0.59088  0.1603
## SC3 -0.2439  0.21273 -0.51781 -0.10119 -0.59088  0.1603
## SC4 -0.2439  0.21273 -0.51781 -0.10119 -0.59088  0.1603
## SC5 -0.2439  0.21273 -0.51781 -0.10119 -0.59088  0.1603
## CA1  0.2920  0.30498  0.58712 -0.31653 -0.14391  0.2938
## CA2  0.2920  0.30498  0.58712 -0.31653 -0.14391  0.2938
## CA3  0.2920  0.30498  0.58712 -0.31653 -0.14391  0.2938
## CA4  0.2920  0.30498  0.58712 -0.31653 -0.14391  0.2938
## CA5  0.2920  0.30498  0.58712 -0.31653 -0.14391  0.2938
## CB1  0.3739  0.31491 -0.04072  0.06864 -0.14623 -0.5648
## CB2  0.3739  0.31491 -0.04072  0.06864 -0.14623 -0.5648
## CB3  0.3739  0.31491 -0.04072  0.06864 -0.14623 -0.5648
## CB4  0.3739  0.31491 -0.04072  0.06864 -0.14623 -0.5648
## CB5  0.3739  0.31491 -0.04072  0.06864 -0.14623 -0.5648
## CC1  0.2824  0.25078 -0.40136  0.17805  0.59347  0.1957
## CC2  0.2824  0.25078 -0.40136  0.17805  0.59347  0.1957
## CC3  0.2824  0.25078 -0.40136  0.17805  0.59347  0.1957
## CC4  0.2824  0.25078 -0.40136  0.17805  0.59347  0.1957
## CC5  0.2824  0.25078 -0.40136  0.17805  0.59347  0.1957
## TA1  0.2476 -0.56732  0.06901  0.30241 -0.21082 -0.1021
## TA2  0.2476 -0.56732  0.06901  0.30241 -0.21082 -0.1021
## TA3  0.2476 -0.56732  0.06901  0.30241 -0.21082 -0.1021
## TA4  0.2476 -0.56732  0.06901  0.30241 -0.21082 -0.1021
## TA5  0.2476 -0.56732  0.06901  0.30241 -0.21082 -0.1021
## TB1  0.1856 -0.49272 -0.12610 -0.23315  0.04536  0.2752
## TB2  0.1856 -0.49272 -0.12610 -0.23315  0.04536  0.2752
## TB3  0.1856 -0.49272 -0.12610 -0.23315  0.04536  0.2752
## TB4  0.1856 -0.49272 -0.12610 -0.23315  0.04536  0.2752
## TB5  0.1856 -0.49272 -0.12610 -0.23315  0.04536  0.2752
## TC1 -0.3727 -0.13586 -0.00121 -0.58045  0.29929 -0.3985
## TC2 -0.3727 -0.13586 -0.00121 -0.58045  0.29929 -0.3985
## TC3 -0.3727 -0.13586 -0.00121 -0.58045  0.29929 -0.3985
## TC4 -0.3727 -0.13586 -0.00121 -0.58045  0.29929 -0.3985
## TC5 -0.3727 -0.13586 -0.00121 -0.58045  0.29929 -0.3985
## 
## 
## Biplot scores for constraining variables
## 
##           RDA1    RDA2    RDA3     RDA4    RDA5     RDA6
## Meanmm  0.4006  0.3802  0.4055  0.32868 -0.1760 -0.02846
## Gravel  0.6672  0.6127  0.2584 -0.17405 -0.1029 -0.24076
## Sand   -0.6947 -0.5127 -0.1909  0.41154 -0.1373  0.05256
## mo      0.7024  0.1586  0.3554 -0.56501  0.1627 -0.04835
## CaCO3   0.7577 -0.2228  0.2098 -0.49473  0.1935 -0.20735
## MNS    -0.4445 -0.5345  0.1183 -0.15249 -0.5333 -0.31802
## MNL     0.3332 -0.4253  0.6256 -0.13139 -0.3497  0.05040
## MLL     0.4308  0.7139  0.5196 -0.08313 -0.1508 -0.04500
plot(result, type = c("text"))

anova(result)
## Permutation test for rda under reduced model
## Permutation: free
## Number of permutations: 999
## 
## Model: rda(X = biot, Y = abiot)
##          Df Variance      F Pr(>F)    
## Model     8  0.23392 4.8182  0.001 ***
## Residual 36  0.21846                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
result<-rda(biot~Gravel+mo+MNL,abiot)# usando variável constrained
plot(result, type = c("text"))

anova(result)
## Permutation test for rda under reduced model
## Permutation: free
## Number of permutations: 999
## 
## Model: rda(formula = biot ~ Gravel + mo + MNL, data = abiot)
##          Df Variance      F Pr(>F)    
## Model     3  0.13292 5.6863  0.001 ***
## Residual 41  0.31946                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
library(vegan)
abio<-read.table("laisabiot2.txt",header=TRUE)
nrow(abio);ncol(abio);head(abio,2)
## [1] 45
## [1] 9
##        Meanmm      Gravel     Sand        mo    CaCO3  MNS      MNL      MLL
## SA1 0.1977082 0.006820706 90.74722 0.7793154 2.026049 15.8 1.276844 10.39545
## SA2 0.1977082 0.006820706 90.74722 0.7793154 2.026049 15.8 1.276844 10.39545
##     Praia
## SA1     S
## SA2     S
abiot<-abio[1:45,1:8]
library(BBmisc)
## Warning: package 'BBmisc' was built under R version 4.1.3
## 
## Attaching package: 'BBmisc'
## The following object is masked from 'package:base':
## 
##     isFALSE
abiotn<-normalize(abiot, method = "standardize", range = c(0, 1), margin = 1L, on.constant = "quiet")
library(vegan)
data(mite)
nrow(mite);ncol(mite)
## [1] 70
## [1] 35
group.1 <- c(1,2,4:8,10:15,17,19:22,24,26:30)
group.2 <- c(3,9,16,18,23,25,31:35)
mite.hel.1 <- decostand(mite[,group.1], "hel")
mite.hel.2 <- decostand(mite[,group.2], "hel")
rownames(mite.hel.1) = paste("S",1:nrow(mite),sep="")
rownames(mite.hel.2) = paste("S",1:nrow(mite),sep="")