#Housekeeping

##Packages

library(readr)
library(tidyverse)
library(lme4)
library(MASS)
library(MuMIn)
library(vegan)
library(fitdistrplus)
library(car)
library(bbmle)
library(arm)
library(corrplot)
library(ade4)
library(lmtest)
library(RColorBrewer)
library(plyr)
library(ggplot2)
library(gridExtra)
library(caret)
library(glmnet)

Session info

SI<-sessionInfo()
print(SI, locale = FALSE)
## R version 4.0.2 (2020-06-22)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Catalina 10.15.6
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] glmnet_4.0-2       caret_6.0-86       gridExtra_2.3      plyr_1.8.6        
##  [5] RColorBrewer_1.1-2 lmtest_0.9-37      zoo_1.8-8          ade4_1.7-15       
##  [9] corrplot_0.84      arm_1.11-2         bbmle_1.0.23.1     car_3.0-9         
## [13] carData_3.0-4      fitdistrplus_1.1-1 survival_3.1-12    vegan_2.5-6       
## [17] lattice_0.20-41    permute_0.9-5      MuMIn_1.43.17      MASS_7.3-51.6     
## [21] lme4_1.1-23        Matrix_1.2-18      forcats_0.5.0      stringr_1.4.0     
## [25] dplyr_1.0.2        purrr_0.3.4        tidyr_1.1.1        tibble_3.0.3      
## [29] ggplot2_3.3.2      tidyverse_1.3.0    readr_1.3.1       
## 
## loaded via a namespace (and not attached):
##  [1] minqa_1.2.4          colorspace_1.4-1     class_7.3-17        
##  [4] ellipsis_0.3.1       rio_0.5.16           htmlTable_2.0.1     
##  [7] base64enc_0.1-3      fs_1.5.0             rstudioapi_0.11     
## [10] prodlim_2019.11.13   fansi_0.4.1          mvtnorm_1.1-1       
## [13] lubridate_1.7.9      xml2_1.3.2           codetools_0.2-16    
## [16] splines_4.0.2        knitr_1.29           Formula_1.2-3       
## [19] jsonlite_1.7.0       nloptr_1.2.2.2       pROC_1.16.2         
## [22] broom_0.7.0          cluster_2.1.0        dbplyr_1.4.4        
## [25] png_0.1-7            compiler_4.0.2       httr_1.4.2          
## [28] backports_1.1.9      assertthat_0.2.1     cli_2.0.2           
## [31] htmltools_0.5.0      tools_4.0.2          coda_0.19-3         
## [34] gtable_0.3.0         glue_1.4.1           reshape2_1.4.4      
## [37] Rcpp_1.0.5           cellranger_1.1.0     vctrs_0.3.2         
## [40] nlme_3.1-148         iterators_1.0.12     timeDate_3043.102   
## [43] gower_0.2.2          xfun_0.16            openxlsx_4.1.5      
## [46] rvest_0.3.6          lifecycle_0.2.0      statmod_1.4.34      
## [49] scales_1.1.1         ipred_0.9-9          hms_0.5.3           
## [52] parallel_4.0.2       yaml_2.2.1           curl_4.3            
## [55] bdsmatrix_1.3-4      rpart_4.1-15         latticeExtra_0.6-29 
## [58] stringi_1.4.6        foreach_1.5.0        checkmate_2.0.0     
## [61] boot_1.3-25          zip_2.1.0            shape_1.4.4         
## [64] lava_1.6.7           rlang_0.4.7          pkgconfig_2.0.3     
## [67] evaluate_0.14        recipes_0.1.13       htmlwidgets_1.5.1   
## [70] tidyselect_1.1.0     magrittr_1.5         R6_2.4.1            
## [73] generics_0.0.2       Hmisc_4.4-1          DBI_1.1.0           
## [76] pillar_1.4.6         haven_2.3.1          foreign_0.8-80      
## [79] withr_2.2.0          mgcv_1.8-31          abind_1.4-5         
## [82] nnet_7.3-14          modelr_0.1.8         crayon_1.3.4        
## [85] rmarkdown_2.3        jpeg_0.1-8.1         grid_4.0.2          
## [88] readxl_1.3.1         data.table_1.13.0    blob_1.2.1          
## [91] ModelMetrics_1.2.2.2 reprex_0.3.0         digest_0.6.25       
## [94] numDeriv_2016.8-1.1  munsell_0.5.0

Import

Abundance and richness data

Combined <- read.csv("Combined.csv")
row.names(Combined)<-Combined$Site
Combined$Site<-NULL
Combined.species<-Combined[19,]
Combined<-Combined[-c(19),]
Combined<-mutate_all(Combined, function(x) as.numeric(as.character(x)))

Distance matrix

# from previous work, calculated from plot to plot. 
distmat <- matrix(c(0,5.17,1.53,3.05,1.44,3.27,0.73,0.93,0.37,3.85,20.43,2.36,3.02,6.04,7.06,8.44,16.98,8.41,5.17,0,5.67,3.42,4.27,2.94,5.81,5.40,5.33,3.22,17.43,4.74,2.14,3.11,2.03,5.31,14.07,6.57,1.53,5.67,0,2.69,1.41,3.09,1.19,0.60,1.16,3.44,19.56,1.41,3.58,7.16,7.34,9.63,16.12,9.79,3.05,3.42,2.69,0,1.63,0.48,3.38,2.71,2.97,0.8,17.43,1.43,1.89,5.79,4.78,8.27,13.98,8.99,1.44,4.27,1.41,1.63,0,1.90,1.78,1.18,1.34,2.43,19.01,1.15,2.17,5.86,6.00,8.35,15.55,8.68,3.27,2.94,3.09,0.48,1.90,0,3.67,3.04,3.23,0.71,17.34,1.89,1.56,5.39,4.32,7.85,13.88,8.64,0.73,5.81,1.19,3.38,1.78,3.67,0,0.73,0.48,4.18,20.60,2.39,3.66,6.76,7.66,9.16,17.16,9.09,0.93,5.40,0.6,2.71,1.18,3.04,0.73,0,0.57,3.51,19.87,1.66,3.26,6.68,7.17,9.14,16.42,9.24,0.37,5.33,1.16,2.97,1.34,3.23,0.48,0.57,0,3.77,20.28,2.12,3.17,6.36,7.18,8.77,16.83,8.77,3.85,3.22,3.44,0.8,2.43,0.71,4.18,3.51,3.77,0,16.66,2.09,2.21,5.91,4.27,8.32,13.21,9.22,20.43,17.43,19.56,17.43,19.01,17.34,20.60,19.87,20.28,16.66,0,18.21,18.40,20.22,15.84,21.46,3.45,23.39,2.36,4.74,1.41,1.43,1.15,1.89,2.39,1.66,2.12,2.09,18.21,0,2.87,6.76,6.21,9.27,14.77,9.74,3.02,2.14,3.58,1.89,2.17,1.56,3.66,3.26,3.17,2.21,18.40,2.87,0,3.95,4.05,6.43,14.99,7.12,6.04,3.11,7.16,5.79,5.86,5.39,6.76,6.68,6.36,5.91,20.22,6.76,3.95,0,4.36,2.51,16.92,3.46,7.06,2.03,7.34,4.78,6,4.32,7.66,7.17,7.18,4.27,15.84,6.21,4.05,4.36,0,5.92,12.57,7.63,8.44,5.31,9.63,8.27,8.35,7.85,9.16,9.14,8.77,8.32,21.46,9.27,6.43,2.51,5.92,0,18.29,2.13,16.98,14.07,16.12,13.98,15.55,13.88,17.16,16.42,16.83,13.21,3.45,14.77,14.99,16.92,12.57,18.29,0,20.16,8.41,6.57,9.79,8.99,8.68,8.64,9.09,9.24,8.77,9.22,23.39,9.74,7.12,3.46,7.63,2.13,20.16,0), nrow = 18, ncol = 18, byrow = TRUE)

Native and non native assignment

non.native_USDA <- read.csv("non-native_USDA.csv")

Explanatory variables

Make DB

Percent_area_Zone <- read.csv("Percent_area_Zone.csv")
totalA <- aggregate(area~descriptio,Percent_area_Zone,sum)
Percent_area_Zone<-merge(Percent_area_Zone,totalA, by="descriptio")
Percent_area_Zone$Per_area<-(Percent_area_Zone$area.x/Percent_area_Zone$area.y)*100
Percent_area_Zone$Name<-NULL
Percent_area_Zone$area.x<-NULL
Percent_area_Zone$area.y<-NULL
Percent_area_Zone$perimeter<-NULL
Zone_cover<-tidyr::spread(Percent_area_Zone,key="CLASS",value= "Per_area")
Zone_cover[is.na(Zone_cover)] <- 0
colnames(Zone_cover) <- c( "Site", "Airport_cover", "Commercial_cover", "Rural_cover", "Environment_cover", "Institution_cover","Minning_cover","Park_cover","Residential_cover")


Dist_to_Roads<- read.csv("Dist_to_roads.csv")
Dist_to_Roads<-tidyr::spread(Dist_to_Roads,key="id_2",value= "distance")
colnames(Dist_to_Roads)<-c("Site","Great_Northern_Rd","HW_17","HW_75","Meeting_Point","Trunk_Road")


IBT_data_1 <- read.csv("IBT_Data.csv")
IBT_data_1$Site<-as.factor(IBT_data_1$Site)

IBT_data_year <- read.csv("Island_surrounding_build_year_kat.csv")
colnames(IBT_data_year)[2]<-"Site"
IBT_data_year$Site<-as.factor(IBT_data_year$Site)
length(IBT_data_year$YearBuilt2)
## [1] 3287
IBT_data_year %>% tidyr::drop_na()->IBT_data_year
length(IBT_data_year$YearBuilt2)
## [1] 2984
IBT_data_year %>% dplyr::group_by(Site) %>% dplyr::summarise(Newest = max(YearBuilt2), Oldest= min(YearBuilt2),Average_building_age= mean(YearBuilt2), SD_building_age = sd(YearBuilt2) ,DiffYears=length(unique(YearBuilt2)))->IBT_data_events
## `summarise()` ungrouping output (override with `.groups` argument)
IBT_data_1[is.na(IBT_data_1$PopulationDensity2),]$PopulationDensity2<-0
IBT_data_1$Av_PopDens<-(IBT_data_1$PopulationDensity2+IBT_data_1$PopulationDensity1)/2
IBT_data_1$PopulationDensity1<-NULL
IBT_data_1$PopulationDensity2<-NULL



IBT_data<-IBT_data_1
IBT_data<-merge(IBT_data_1,Zone_cover,by="Site")
IBT_data<-merge(IBT_data,IBT_data_events,by="Site")

Var selection

colnames(IBT_data)
##  [1] "Site"                 "Name"                 "Site_number"         
##  [4] "Area_m2"              "Perimeter_m"          "Distance_m"          
##  [7] "Closest_Road"         "sp_rich"              "Diversity"           
## [10] "Evenness"             "Exotic_Native_Ratio"  "Native"              
## [13] "Exotic"               "per_exo"              "sw_div"              
## [16] "per_nat"              "Av_PopDens"           "Airport_cover"       
## [19] "Commercial_cover"     "Rural_cover"          "Environment_cover"   
## [22] "Institution_cover"    "Minning_cover"        "Park_cover"          
## [25] "Residential_cover"    "Newest"               "Oldest"              
## [28] "Average_building_age" "SD_building_age"      "DiffYears"
IBT_data$P_A_ratio<-IBT_data$Perimeter_m/IBT_data$Area_m2
IBT_data$Site<-rownames(IBT_data)

Y<-IBT_data[c(4,5:7,17,19,20,21,25,28,31)]
covar_cor = cor(Y)
write.csv(covar_cor,"covar_cor.csv")
mydata.rcorr = Hmisc::rcorr(as.matrix(Y))
covar_cor.p = mydata.rcorr$P
corrplot.mixed(covar_cor, upper = "ellipse", lower = "number")

IBT_PCA = dudi.pca(df = Y, scannf = FALSE, nf = 2, center = TRUE, scale = TRUE)
IBT_PCA$co
##                            Comp1       Comp2
## Area_m2              -0.83055978 -0.23118749
## Perimeter_m          -0.92049970 -0.10852220
## Distance_m            0.39930461 -0.77326984
## Closest_Road         -0.50651299 -0.73943756
## Av_PopDens           -0.62280650  0.29502854
## Commercial_cover      0.22103993 -0.20630908
## Rural_cover          -0.91910930  0.10673178
## Environment_cover    -0.58573112  0.24184569
## Residential_cover     0.85690525  0.18060601
## Average_building_age -0.07559943  0.82093034
## P_A_ratio             0.86303462  0.02170061
s.corcircle(IBT_PCA$co)

IBT_PCA$eig/sum(IBT_PCA$eig)
##  [1] 0.4602335361 0.1924037486 0.1037752140 0.0771352020 0.0629644116
##  [6] 0.0326285525 0.0274360411 0.0240211060 0.0107620722 0.0079182427
## [11] 0.0007218732
# Notes about what is correlated. 
# area and perimeter -> use area only
# Area and rural cover -> only use area because it is a critical component. 
# important thing is that the area of an island is related to the rural cover, so more likely to be rural.

TRY<-IBT_data

H1

Size and diversity model

Large forest islands close to the “forest mainland” will have greater species richness as compared to small forest islands far from the "forest mainland

Linear Model Selection

Model

car::qqp(IBT_data$sp_rich, "norm")

## [1] 5 3
plot(density(IBT_data$sp_rich))

shapiro.test(IBT_data$sp_rich)
## 
##  Shapiro-Wilk normality test
## 
## data:  IBT_data$sp_rich
## W = 0.91968, p-value = 0.1276
model_sprich <- lm(sp_rich~ Area_m2 + 
              Distance_m +
              P_A_ratio+
              Closest_Road+
                Commercial_cover+
                Residential_cover+
                Av_PopDens,
              data = TRY)


plot(model_sprich)

## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced

## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced

olsrr::ols_test_breusch_pagan(model_sprich)
## 
##  Breusch Pagan Test for Heteroskedasticity
##  -----------------------------------------
##  Ho: the variance is constant            
##  Ha: the variance is not constant        
## 
##                Data                 
##  -----------------------------------
##  Response : sp_rich 
##  Variables: fitted values of sp_rich 
## 
##         Test Summary         
##  ----------------------------
##  DF            =    1 
##  Chi2          =    0.5169307 
##  Prob > Chi2   =    0.4721539
vif(model_sprich)
##           Area_m2        Distance_m         P_A_ratio      Closest_Road 
##          2.541593          2.812171          3.154475          4.540278 
##  Commercial_cover Residential_cover        Av_PopDens 
##          1.147406          4.693327          1.697393

####MuMIn

options(na.action="na.fail")

modAll1<-lm(sp_rich~ Area_m2 +Distance_m +
              Commercial_cover+
                Residential_cover+
                Closest_Road+
              Av_PopDens+
                Average_building_age,
              data = TRY)
modAll.d<-dredge(modAll1)
## Fixed term is "(Intercept)"
modAll.d
## Global model call: lm(formula = sp_rich ~ Area_m2 + Distance_m + Commercial_cover + 
##     Residential_cover + Closest_Road + Av_PopDens + Average_building_age, 
##     data = TRY)
## ---
## Model selection table 
##        (Int)     Are_m2    Av_PpD Avr_bld_age    Cls_Rod Cmm_cvr     Dst_m
## 37  -1917.00                          0.98640                    0.0052780
## 1      53.78                                                              
## 33     40.40                                                     0.0031560
## 17     54.97                                             -0.4833          
## 2      56.45 -1.191e-05                                                   
## 49     41.26                                             -0.5138 0.0032520
## 65     48.22                                                              
## 35     26.83             0.027930                                0.0037700
## 53  -1685.00                          0.86970            -0.3119 0.0050850
## 10     53.90 -2.293e-05                        2.580e-03                  
## 39  -1763.00             0.018130     0.90460                    0.0055000
## 5    -571.80                          0.31680                             
## 9      52.02                                   9.045e-04                  
## 34     43.66 -9.057e-06                                          0.0028670
## 38  -1824.00 -6.394e-06               0.94090                    0.0049760
## 3      48.60             0.013170                                         
## 45  -2023.00                          1.04000  6.215e-04         0.0050280
## 73     37.82                                   2.489e-03                  
## 14  -1609.00 -2.871e-05               0.84140  4.052e-03                  
## 97     38.30                                                     0.0028480
## 101 -1924.00                          0.99020                    0.0052970
## 18     58.26 -1.384e-05                                  -0.5599          
## 41     40.35                                  -1.067e-04         0.0032180
## 67     28.03             0.039350                                         
## 75     10.80             0.048790              2.965e-03                  
## 99     11.03             0.049180                                0.0034370
## 81     49.10                                             -0.5091          
## 4      47.71 -1.495e-05  0.023960                                         
## 50     45.31 -1.098e-05                                  -0.5714 0.0029120
## 36     27.37 -1.300e-05  0.036410                                0.0035420
## 26     55.71 -2.430e-05                        2.477e-03 -0.5279          
## 6    -543.10 -1.173e-05               0.30360                             
## 25     53.49                                   7.278e-04 -0.4568          
## 13  -1001.00                          0.53240  1.568e-03                  
## 77  -1240.00                          0.64560  3.442e-03                  
## 66     52.76 -8.558e-06                                                   
## 21   -316.10                          0.18780            -0.4359          
## 51     30.97             0.020870                        -0.4240 0.0036940
## 19     52.59             0.005891                        -0.4568          
## 69   -456.70                          0.25590                             
## 74     43.82 -1.707e-05                        3.224e-03                  
## 113    38.98                                             -0.5269 0.0029170
## 46  -2083.00 -1.892e-05               1.07500  2.574e-03         0.0033520
## 12     45.60 -2.566e-05  0.022860              2.541e-03                  
## 89     39.38                                   2.303e-03 -0.4477          
## 57     41.08                                  -3.965e-04 -0.5304 0.0034880
## 11     48.14             0.010410              7.959e-04                  
## 43     23.90             0.033040             -8.095e-04         0.0043570
## 7    -475.70             0.008291     0.26650                             
## 42     47.58 -1.743e-05                        1.670e-03         0.0016190
## 78  -1635.00 -2.278e-05               0.84910  4.723e-03                  
## 76     16.49 -1.760e-05  0.049710              3.731e-03                  
## 40  -1563.00 -9.534e-06  0.025440     0.80380                    0.0051400
## 54  -1522.00 -8.077e-06               0.78940            -0.3729 0.0046660
## 105    36.43                                   1.526e-03         0.0015560
## 98     42.67 -7.993e-06                                          0.0028120
## 83     32.69             0.031580                        -0.3832          
## 55  -1599.00             0.014690     0.82300            -0.2595 0.0052980
## 103 -1394.00             0.030330     0.71400                    0.0049770
## 20     51.99 -1.573e-05  0.016620                        -0.4956          
## 30  -1332.00 -2.861e-05               0.70180  3.743e-03 -0.3288          
## 61  -1768.00                          0.91170  3.751e-04 -0.2864 0.0049500
## 82     54.91 -1.079e-05                                  -0.5546          
## 102 -1975.00 -9.583e-06               1.01900                    0.0053240
## 68     32.60 -7.927e-06  0.038660                                         
## 117 -1642.00                          0.84820            -0.3189 0.0049870
## 22   -232.50 -1.362e-05               0.14720            -0.5216          
## 47  -1807.00             0.016700     0.92730  1.873e-04         0.0054080
## 109 -1908.00                          0.98120  1.413e-03         0.0040780
## 71    145.10             0.041300    -0.05982                             
## 115    15.65             0.041680                        -0.3636 0.0033950
## 52     31.90 -1.377e-05  0.029260                        -0.4602 0.0034450
## 16  -1514.00 -2.907e-05  0.005903     0.79190  3.955e-03                  
## 107     8.07             0.050580              1.775e-03         0.0019510
## 85   -160.80                          0.10630            -0.4815          
## 90     46.16 -1.874e-05                        3.085e-03 -0.5057          
## 79   -654.70             0.039050     0.33900  3.371e-03                  
## 91     14.97             0.042920              2.799e-03 -0.2633          
## 100    15.31 -7.085e-06  0.048440                                0.0033970
## 8    -301.30 -1.438e-05  0.020300     0.17740                             
## 29   -716.90                          0.38940  1.259e-03 -0.3394          
## 58     48.62 -1.813e-05                        1.441e-03 -0.5485 0.0018330
## 70   -498.20 -9.133e-06               0.27940                             
## 28     49.70 -2.605e-05  0.015990              2.461e-03 -0.4662          
## 27     52.05             0.003723              6.949e-04 -0.4413          
## 15  -1047.00            -0.002676     0.55660  1.626e-03                  
## 44     31.08 -1.753e-05  0.033230              9.734e-04         0.0027550
## 23   -284.50             0.003252     0.17120            -0.4255          
## 114    44.65 -1.027e-05                                  -0.5700 0.0028760
## 93   -992.80                          0.52120  3.138e-03 -0.2898          
## 59     27.83             0.026360             -9.069e-04 -0.4385 0.0043500
## 121    37.70                                   1.010e-03 -0.4947 0.0020570
## 106    43.65 -1.685e-05                        3.148e-03         0.0001061
## 80  -1108.00 -2.128e-05  0.033410     0.57330  4.577e-03                  
## 62  -1819.00 -1.911e-05               0.94140  2.338e-03 -0.2975 0.0032530
## 48  -1873.00 -1.882e-05  0.016240     0.96460  2.141e-03         0.0037300
## 84     38.92 -9.811e-06  0.029740                        -0.4318          
## 110 -1987.00 -1.859e-05               1.02500  3.198e-03         0.0025910
## 92     21.91 -1.859e-05  0.042570              3.570e-03 -0.3224          
## 94  -1381.00 -2.291e-05               0.72140  4.415e-03 -0.3001          
## 56  -1345.00 -1.053e-05  0.022070     0.69480            -0.3128 0.0048580
## 87    313.50             0.035830    -0.14340            -0.4035          
## 24    -70.26 -1.551e-05  0.015520     0.06208            -0.4837          
## 108    15.40 -1.651e-05  0.050130              3.362e-03         0.0005267
## 86   -184.50 -1.092e-05               0.12130            -0.5235          
## 111 -1340.00             0.032360     0.68530  1.606e-03         0.0035700
## 118 -1663.00 -1.078e-05               0.86160            -0.3608 0.0049770
## 104 -1476.00 -8.647e-06  0.028260     0.75850                    0.0050230
## 72     83.38 -7.860e-06  0.039510    -0.02598                             
## 119 -1212.00             0.027210     0.62340            -0.2674 0.0047500
## 63  -1605.00             0.014540     0.82580  2.075e-05 -0.2586 0.0052880
## 125 -1663.00                          0.85820  1.135e-03 -0.2803 0.0040450
## 116    21.58 -8.879e-06  0.039850                        -0.4080 0.0033390
## 32  -1278.00 -2.883e-05  0.003682     0.67360  3.689e-03 -0.3226          
## 123    12.60             0.043910              1.419e-03 -0.3096 0.0022120
## 31   -797.50            -0.004995     0.43120  1.360e-03 -0.3477          
## 60     35.40 -1.809e-05  0.026270              9.290e-04 -0.4568 0.0026960
## 95   -516.20             0.036350     0.27010  3.155e-03 -0.2097          
## 122    45.29 -1.761e-05                        2.684e-03 -0.5151 0.0005629
## 88    256.10 -9.587e-06  0.033070    -0.11100            -0.4465          
## 112 -1453.00 -1.791e-05  0.030240     0.74680  3.314e-03         0.0021700
## 96   -959.40 -2.152e-05  0.030360     0.49960  4.352e-03 -0.2326          
## 64  -1662.00 -1.901e-05  0.013980     0.85870  1.987e-03 -0.2708 0.0035880
## 126 -1733.00 -1.880e-05               0.89710  2.928e-03 -0.2923 0.0025400
## 124    20.52 -1.705e-05  0.042940              3.031e-03 -0.3335 0.0007621
## 120 -1276.00 -9.810e-06  0.024360     0.65910            -0.3109 0.0047660
## 127 -1200.00             0.029540     0.61610  1.375e-03 -0.2162 0.0035890
## 128 -1304.00 -1.815e-05  0.027170     0.67310  3.087e-03 -0.2330 0.0021730
##       Rsd_cvr df  logLik  AICc delta weight
## 37             4 -73.917 158.9  0.00  0.116
## 1              2 -77.482 159.8  0.85  0.075
## 33             3 -76.037 159.8  0.88  0.075
## 17             3 -76.837 161.4  2.48  0.034
## 2              3 -76.852 161.4  2.51  0.033
## 49             4 -75.171 161.4  2.51  0.033
## 65   0.124700  3 -76.974 161.7  2.75  0.029
## 35             4 -75.384 161.8  2.93  0.027
## 53             5 -73.559 162.1  3.21  0.023
## 10             4 -75.527 162.1  3.22  0.023
## 39             5 -73.592 162.2  3.27  0.023
## 5              3 -77.251 162.2  3.31  0.022
## 9              3 -77.275 162.3  3.35  0.022
## 34             4 -75.628 162.3  3.42  0.021
## 38             5 -73.667 162.3  3.42  0.021
## 3              3 -77.351 162.4  3.50  0.020
## 45             5 -73.807 162.6  3.70  0.018
## 73   0.249300  4 -75.777 162.6  3.72  0.018
## 14             5 -73.844 162.7  3.78  0.017
## 97   0.076330  4 -75.832 162.7  3.83  0.017
## 101 -0.002674  5 -73.917 162.8  3.92  0.016
## 18             4 -75.925 162.9  4.02  0.016
## 41             4 -76.034 163.1  4.23  0.014
## 67   0.230400  4 -76.073 163.2  4.31  0.013
## 75   0.404300  5 -74.186 163.4  4.46  0.012
## 99   0.198500  5 -74.230 163.5  4.55  0.012
## 81   0.133000  4 -76.213 163.5  4.59  0.012
## 4              4 -76.420 163.9  5.01  0.009
## 50             5 -74.511 164.0  5.11  0.009
## 36             5 -74.520 164.0  5.13  0.009
## 26             5 -74.574 164.1  5.24  0.008
## 6              4 -76.624 164.3  5.41  0.008
## 25             4 -76.695 164.5  5.55  0.007
## 13             4 -76.711 164.5  5.59  0.007
## 77   0.272600  5 -74.790 164.6  5.67  0.007
## 66   0.065750  4 -76.755 164.6  5.68  0.007
## 21             4 -76.756 164.6  5.68  0.007
## 51             5 -74.804 164.6  5.70  0.007
## 19             4 -76.810 164.7  5.79  0.006
## 69   0.115000  4 -76.818 164.7  5.80  0.006
## 74   0.168500  5 -74.863 164.7  5.81  0.006
## 113  0.083760  5 -74.899 164.8  5.89  0.006
## 46             6 -72.643 164.9  6.01  0.006
## 12             5 -75.072 165.1  6.23  0.005
## 89   0.247300  5 -75.116 165.2  6.32  0.005
## 57             5 -75.130 165.3  6.35  0.005
## 11             4 -77.194 165.5  6.55  0.004
## 43             5 -75.236 165.5  6.56  0.004
## 7              4 -77.204 165.5  6.57  0.004
## 42             5 -75.279 165.6  6.65  0.004
## 78   0.172200  6 -73.001 165.6  6.73  0.004
## 76   0.323900  6 -73.011 165.7  6.75  0.004
## 40             6 -73.061 165.8  6.85  0.004
## 54             6 -73.153 165.9  7.03  0.003
## 105  0.174700  5 -75.602 166.2  7.29  0.003
## 98   0.021920  5 -75.616 166.2  7.32  0.003
## 83   0.215800  5 -75.643 166.3  7.37  0.003
## 55             6 -73.348 166.3  7.42  0.003
## 103  0.094720  6 -73.377 166.4  7.48  0.003
## 20             5 -75.711 166.4  7.51  0.003
## 30             6 -73.464 166.6  7.65  0.003
## 61             6 -73.519 166.7  7.76  0.002
## 82   0.059420  5 -75.838 166.7  7.76  0.002
## 102 -0.070190  6 -73.531 166.7  7.79  0.002
## 68   0.174000  5 -75.866 166.7  7.82  0.002
## 117  0.013150  6 -73.552 166.7  7.83  0.002
## 22             5 -75.871 166.7  7.83  0.002
## 47             6 -73.584 166.8  7.89  0.002
## 109  0.089120  6 -73.673 167.0  8.07  0.002
## 71   0.237900  5 -76.066 167.1  8.22  0.002
## 115  0.185000  6 -73.754 167.1  8.23  0.002
## 52             6 -73.764 167.2  8.25  0.002
## 16             6 -73.815 167.3  8.35  0.002
## 107  0.316400  6 -73.856 167.3  8.44  0.002
## 85   0.128500  5 -76.186 167.4  8.46  0.002
## 90   0.158400  6 -73.925 167.5  8.57  0.002
## 79   0.385500  6 -73.944 167.5  8.61  0.002
## 91   0.384400  6 -73.945 167.5  8.61  0.002
## 100  0.148500  6 -74.028 167.7  8.78  0.001
## 8              5 -76.350 167.7  8.79  0.001
## 29             5 -76.418 167.8  8.92  0.001
## 58             6 -74.220 168.1  9.16  0.001
## 70   0.051230  5 -76.566 168.1  9.22  0.001
## 28             6 -74.343 168.3  9.41  0.001
## 27             5 -76.684 168.4  9.46  0.001
## 15             5 -76.707 168.4  9.50  0.001
## 44             6 -74.397 168.4  9.52  0.001
## 23             5 -76.749 168.5  9.59  0.001
## 114  0.014420  6 -74.505 168.6  9.74  0.001
## 93   0.266800  6 -74.527 168.7  9.78  0.001
## 59             6 -74.606 168.8  9.94  0.001
## 121  0.148400  6 -74.791 169.2 10.31  0.001
## 106  0.164500  6 -74.862 169.4 10.45  0.001
## 80   0.275400  7 -72.259 169.7 10.81  0.001
## 62             7 -72.289 169.8 10.87  0.001
## 48             7 -72.403 170.0 11.09  0.000
## 84   0.144100  6 -75.316 170.3 11.36  0.000
## 110  0.074060  7 -72.538 170.3 11.37  0.000
## 92   0.295100  7 -72.599 170.4 11.49  0.000
## 94   0.165600  7 -72.655 170.5 11.60  0.000
## 56             7 -72.688 170.6 11.66  0.000
## 87   0.233000  6 -75.602 170.8 11.93  0.000
## 24             6 -75.702 171.0 12.13  0.000
## 108  0.305100  7 -72.988 171.2 12.26  0.000
## 86   0.053470  6 -75.802 171.2 12.33  0.000
## 111  0.205600  7 -73.042 171.3 12.37  0.000
## 118 -0.060730  7 -73.046 171.3 12.38  0.000
## 104  0.027170  7 -73.047 171.3 12.38  0.000
## 72   0.177700  6 -75.865 171.4 12.45  0.000
## 119  0.097970  7 -73.111 171.4 12.51  0.000
## 63             7 -73.348 171.9 12.98  0.000
## 125  0.084970  7 -73.394 172.0 13.08  0.000
## 116  0.120600  7 -73.424 172.0 13.14  0.000
## 32             7 -73.452 172.1 13.19  0.000
## 123  0.281300  7 -73.515 172.2 13.32  0.000
## 31             6 -76.402 172.4 13.53  0.000
## 60             7 -73.642 172.5 13.57  0.000
## 95   0.373600  7 -73.798 172.8 13.88  0.000
## 122  0.136700  7 -73.902 173.0 14.09  0.000
## 88   0.159000  7 -75.291 175.8 16.87  0.000
## 112  0.183400  8 -71.916 175.8 16.92  0.000
## 96   0.260900  8 -72.041 176.1 17.17  0.000
## 64             8 -72.108 176.2 17.30  0.000
## 126  0.069560  8 -72.193 176.4 17.48  0.000
## 124  0.267000  8 -72.551 177.1 18.19  0.000
## 120  0.021860  8 -72.679 177.4 18.45  0.000
## 127  0.192200  8 -72.870 177.7 18.83  0.000
## 128  0.168800  9 -71.689 183.9 24.97  0.000
## Models ranked by AICc(x)
dim(modAll.d)
## [1] 128  13
dim(subset(modAll.d, cumsum(weight) <= .95) )
## [1] 63 13
avgmod1.95p <- model.avg(modAll.d, cumsum(weight) <= .95)
confint(avgmod1.95p)
##                              2.5 %       97.5 %
## (Intercept)          -2.585186e+03 1.548056e+03
## Average_building_age -3.599484e-01 2.027279e+00
## Distance_m           -6.624450e-04 8.989557e-03
## Commercial_cover     -1.410364e+00 4.747541e-01
## Area_m2              -4.399938e-05 1.349979e-05
## Residential_cover    -2.087168e-01 5.346398e-01
## Av_PopDens           -3.778130e-02 9.203323e-02
## Closest_Road         -2.510064e-03 6.465953e-03
DF<-data.frame(TRY$Distance_m, TRY$Commercial_cover, TRY$Residential_cover, TRY$Closest_Road, TRY$Average_building_age)
hier.part::hier.part(TRY$sp_rich,DF,"gaussian")

## $gfs
##  [1] 0.00000000 0.14836012 0.06925920 0.05496087 0.02278603 0.02535045
##  [7] 0.22650228 0.16755712 0.14861869 0.32706677 0.13158517 0.08380366
## [13] 0.07750842 0.17261738 0.07117181 0.08210893 0.24956694 0.22999090
## [19] 0.35335397 0.18859200 0.32708764 0.33530767 0.23120226 0.13415844
## [25] 0.11151621 0.25856709 0.25848024 0.35384530 0.35618003 0.34511032
## [31] 0.27992569 0.36508136
## 
## $IJ
##                                   I            J      Total
## TRY.Distance_m           0.14598463  0.002375490 0.14836012
## TRY.Commercial_cover     0.04954193  0.019717270 0.06925920
## TRY.Residential_cover    0.05177638  0.003184484 0.05496087
## TRY.Closest_Road         0.03683461 -0.014048573 0.02278603
## TRY.Average_building_age 0.08094382 -0.055593371 0.02535045
## 
## $I.perc
##                          ind.exp.var
## TRY.Distance_m              39.98687
## TRY.Commercial_cover        13.57011
## TRY.Residential_cover       14.18215
## TRY.Closest_Road            10.08942
## TRY.Average_building_age    22.17145
## 
## $params
## $params$full.model
## [1] "y ~ TRY.Distance_m + TRY.Commercial_cover + TRY.Residential_cover + TRY.Closest_Road + TRY.Average_building_age"
## 
## $params$family
## [1] "gaussian"
## 
## $params$link
## [1] "default"
## 
## $params$gof
## [1] "Rsqu"
model_sprichmBest<-lm(sp_rich~ Area_m2 +Distance_m +Average_building_age,data = TRY)

Plots

model_sprich<-update(model_sprichmBest,.~.+Area_m2)
(Area_AND_richness_plot<-jtools::effect_plot(model_sprich, pred=Area_m2, interval = TRUE,
                                             int.type = "confidence",data = IBT_data)+
    geom_smooth(color=c('red'))+
    geom_point(aes(Area_m2,sp_rich),TRY)+
    labs(x="\nArea (m^2)", y="Species richness")+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

(Dist_AND_richness_plot<-jtools::effect_plot(model_sprich, pred=Distance_m, interval = TRUE,
                                             int.type = "confidence",data = IBT_data)+
    geom_smooth(color=c('red'))+
    geom_point(aes(Distance_m,sp_rich),TRY)+
    labs(x="\nDistance (m)", y="Species richness")+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

(Controlled_richness_plots<-grid.arrange(Area_AND_richness_plot,Dist_AND_richness_plot, nrow = 1))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

## TableGrob (1 x 2) "arrange": 2 grobs
##   z     cells    name           grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
ggsave("Controlled_richness_plots.pdf", Controlled_richness_plots,width = 10, height = 5)

H2

Urban forest islands that are closer together will be more similar in species composition than those farther apart.

Mantel Corr

Overall

simmat<- vegdist(Combined, "bray",diag=T)

mantel(simmat, distmat)
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = simmat, ydis = distmat) 
## 
## Mantel statistic r: 0.0316 
##       Significance: 0.37 
## 
## Upper quantiles of permutations (null model):
##   90%   95% 97.5%   99% 
## 0.127 0.164 0.189 0.221 
## Permutation: free
## Number of permutations: 999
dis.mancor <- mantel.correlog(D.eco = simmat, D.geo = distmat, nperm = 1000)

(mancor_plot<-plot(dis.mancor))

## NULL

invasive

Combined_invasive <-data.frame(c(1:18))
Combined_native <-data.frame(c(1:18))
V <- vector()
c<-1
d<-1
non.native_USDA$Scientific.Name <- as.character(non.native_USDA$Scientific.Name)
for (i in 1:length(non.native_USDA$Scientific.Name))for(j in 1:length(names(Combined.species))) if(non.native_USDA$Scientific.Name[i]==Combined.species[1,j]){
  Combined_invasive[,c] <- c(1:18)
  Combined_invasive[,c] <- Combined[,j]
  V[c] <- j
  names(Combined_invasive)[c]<-non.native_USDA$Scientific.Name[i]
  c<-c+1
}
Combined_native <- Combined[,-c(unique(V))]



rowSums(Combined_invasive)
##  [1]  27  47 289 104  40 317 240  40  11 129   0  40  57   4  48  28  48   0
Combined_invasive2<-Combined_invasive[-c(11,18),]
distmat.inv<-distmat[-c(11,18), -c(11,18)]
simmat.inv<- vegdist(Combined_invasive2, "bray",diag=T)
mantel(simmat.inv,distmat.inv)
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = simmat.inv, ydis = distmat.inv) 
## 
## Mantel statistic r: 0.3133 
##       Significance: 0.003 
## 
## Upper quantiles of permutations (null model):
##   90%   95% 97.5%   99% 
## 0.156 0.198 0.223 0.264 
## Permutation: free
## Number of permutations: 999
inv.mancor <- mantel.correlog(D.eco = simmat.inv, D.geo = distmat.inv, nperm = 1000)
summary(inv.mancor)
##            Length Class  Mode     
## mantel.res 40     -none- numeric  
## n.class     1     -none- numeric  
## break.pts   9     -none- numeric  
## mult        1     -none- character
## n.tests     1     -none- numeric  
## call        4     -none- call
inv.mancor
## 
## Mantel Correlogram Analysis
## 
## Call:
##  
## mantel.correlog(D.eco = simmat.inv, D.geo = distmat.inv, nperm = 1000) 
## 
##        class.index    n.dist Mantel.cor Pr(Mantel) Pr(corrected)   
## D.cl.1    1.490000 74.000000   0.393146     0.0020      0.001998 **
## D.cl.2    3.730000 66.000000  -0.018273     0.4665      0.466533   
## D.cl.3    5.970000 40.000000  -0.249692     0.0020      0.005994 **
## D.cl.4    8.210000 28.000000  -0.148346     0.0709      0.141858   
## D.cl.5   10.450000  2.000000         NA         NA            NA   
## D.cl.6   12.690000  4.000000         NA         NA            NA   
## D.cl.7   14.930000 12.000000         NA         NA            NA   
## D.cl.8   17.170000 14.000000         NA         NA            NA   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
inv.mancor_plot <-plot(inv.mancor)

native

Combined_native2<-Combined_native[-c(11,18),]
simmat.nat<- vegdist(Combined_native2, "bray",diag=T)
mantel(simmat.nat, distmat.inv)
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = simmat.nat, ydis = distmat.inv) 
## 
## Mantel statistic r: 0.001443 
##       Significance: 0.45 
## 
## Upper quantiles of permutations (null model):
##   90%   95% 97.5%   99% 
## 0.129 0.155 0.186 0.209 
## Permutation: free
## Number of permutations: 999
nat.mancor <- mantel.correlog(D.eco = simmat.nat, D.geo = distmat.inv, nperm = 1000)
nat.mancor
## 
## Mantel Correlogram Analysis
## 
## Call:
##  
## mantel.correlog(D.eco = simmat.nat, D.geo = distmat.inv, nperm = 1000) 
## 
##        class.index    n.dist Mantel.cor Pr(Mantel) Pr(corrected)  
## D.cl.1    1.490000 74.000000   0.135157     0.0769       0.07692 .
## D.cl.2    3.730000 66.000000  -0.159627     0.0420       0.08392 .
## D.cl.3    5.970000 40.000000   0.019671     0.3816       0.38162  
## D.cl.4    8.210000 28.000000  -0.072381     0.2268       0.45355  
## D.cl.5   10.450000  2.000000         NA         NA            NA  
## D.cl.6   12.690000  4.000000         NA         NA            NA  
## D.cl.7   14.930000 12.000000         NA         NA            NA  
## D.cl.8   17.170000 14.000000         NA         NA            NA  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
nat.mancor_plot <-plot(nat.mancor)

Overall subsamp

Combined_sub<-Combined[-c(11,18),]
simmat<- vegdist(Combined_sub, "bray",diag=T)
mantel(simmat, distmat.inv)
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = simmat, ydis = distmat.inv) 
## 
## Mantel statistic r: 0.1024 
##       Significance: 0.158 
## 
## Upper quantiles of permutations (null model):
##   90%   95% 97.5%   99% 
## 0.132 0.165 0.196 0.230 
## Permutation: free
## Number of permutations: 999
dis.mancor <- mantel.correlog(D.eco = simmat, D.geo = distmat.inv, nperm = 1000)
summary(dis.mancor)
##            Length Class  Mode     
## mantel.res 40     -none- numeric  
## n.class     1     -none- numeric  
## break.pts   9     -none- numeric  
## mult        1     -none- character
## n.tests     1     -none- numeric  
## call        4     -none- call
dis.mancor_plot <-plot(dis.mancor)

###Plot

#create a dataframe for the correlograms - all
bs.df <- data.frame(dis.mancor$mantel.res)
bs.df$Method <- "Bray"
bs.df$Species <- "All species"
#create a dataframe for the correlograms - invasive
ls.df <- data.frame(inv.mancor$mantel.res)
ls.df$Method <- "Bray"
ls.df$Species <- "Invasive species"
#create a dataframe for the correlograms - native
rs.df <- data.frame(nat.mancor$mantel.res)
rs.df$Method <- "Bray"
rs.df$Species <- "Native species"

#make a single data frame
man.df <- rbind(bs.df, ls.df,rs.df)

#make a significance factor
man.df$Significance <- ifelse(man.df$Pr.corrected. < 0.05, "Significant", "Insignificant")
#make a distance class factor
man.df$Distance.Class <- rownames(man.df)

#plot the correlograms
(mantel.cor.plot<-ggplot(man.df, aes(class.index, Mantel.cor, group=Species, shape=Species, col = Species))  +
  geom_hline(yintercept=0.00, color="grey") + 
  geom_line() +
  geom_point(aes(fill=Significance, size=3)) + 
  scale_shape_manual(values = c(21, 22, 24)) +
  scale_fill_manual(values=c("white", "black"))+
  scale_color_manual(values=c("darkorchid3", "red", "royalblue3"))+
  ylab("Mantel Correlation") + 
  xlab("Distance Class")  +
  xlim(0, 10)+
  theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## Warning: Removed 12 row(s) containing missing values (geom_path).
## Warning: Removed 12 rows containing missing values (geom_point).

ggsave("mantel_cor_plot.pdf", plot=mantel.cor.plot, height = 5, width =7)
## Warning: Removed 12 row(s) containing missing values (geom_path).

## Warning: Removed 12 rows containing missing values (geom_point).

H3

Small forest islands will have a greater number of exotic species as compared to large forest islands in part due to their less species rich native communities and the higher level of disturbances in small fragments.

Model Exotic:Native to space

FIT

bin <- cbind(TRY$Exotic, TRY$Native)


modelExo<- glm(bin ~ Area_m2 + 
              Distance_m +
              P_A_ratio+
              Closest_Road+
                Commercial_cover+
                Residential_cover+
                Rural_cover,
              data = TRY, family = "binomial") 

plot(modelExo)

## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced

## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced

lmtest::bptest(modelExo)
## 
##  studentized Breusch-Pagan test
## 
## data:  modelExo
## BP = 5.0857, df = 7, p-value = 0.6495
vif(modelExo)
##           Area_m2        Distance_m         P_A_ratio      Closest_Road 
##          4.929727          4.118133          2.288017          7.096241 
##  Commercial_cover Residential_cover       Rural_cover 
##          1.020422          4.779306          6.871009

###MuMI

modAll2<-lm(Exotic_Native_Ratio~ Area_m2 +Distance_m +
              Commercial_cover+
                Residential_cover+
                Closest_Road+
                Average_building_age,
              data = TRY)
modAll2.d<-dredge(modAll2)
## Fixed term is "(Intercept)"
dim(modAll2.d)
## [1] 64 12
dim(subset(modAll2.d, cumsum(weight) <= .95) )
## [1]  9 12
avgmod2.95p <- model.avg(modAll2.d, cumsum(weight) <= .95)
confint(avgmod2.95p)
##                              2.5 %        97.5 %
## (Intercept)          -2.662714e+01 -5.513492e+00
## Average_building_age  3.111891e-03  1.331171e-02
## Closest_Road          1.231977e-05  5.104410e-05
## Residential_cover     1.480596e-03  5.129473e-03
## Distance_m           -1.164063e-05  6.122029e-05
## Area_m2              -1.886306e-07  7.479477e-08
## Commercial_cover     -2.852716e-03  5.548209e-03
DF<-data.frame( TRY$Residential_cover, TRY$Closest_Road, TRY$Average_building_age)
hier.part::hier.part(TRY$Exotic_Native_Ratio,DF,"gaussian")

## $gfs
## [1] 0.000000000 0.341997886 0.000143118 0.124155367 0.513458976 0.416164966
## [7] 0.154220493 0.747625544
## 
## $IJ
##                                  I           J       Total
## TRY.Residential_cover    0.4460219 -0.10402400 0.341997886
## TRY.Closest_Road         0.1441223 -0.14397915 0.000143118
## TRY.Average_building_age 0.1574814 -0.03332602 0.124155367
## 
## $I.perc
##                          ind.exp.var
## TRY.Residential_cover       59.65846
## TRY.Closest_Road            19.27733
## TRY.Average_building_age    21.06421
## 
## $params
## $params$full.model
## [1] "y ~ TRY.Residential_cover + TRY.Closest_Road + TRY.Average_building_age"
## 
## $params$family
## [1] "gaussian"
## 
## $params$link
## [1] "default"
## 
## $params$gof
## [1] "Rsqu"
modAll.lm<-lm(Exotic_Native_Ratio~Residential_cover+
                Closest_Road+
                Average_building_age,
              data = TRY)
summary(modAll.lm)$adj.r.squared 
## [1] 0.6935453

Plot Exotic:Native to space

modelExo.signif<-update(modAll.lm,.~.+Area_m2+Distance_m)
summary(modelExo.signif)
## 
## Call:
## lm(formula = Exotic_Native_Ratio ~ Residential_cover + Closest_Road + 
##     Average_building_age + Area_m2 + Distance_m, data = TRY)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.095916 -0.055393  0.001226  0.031492  0.125740 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)   
## (Intercept)          -1.800e+01  4.771e+00  -3.773  0.00266 **
## Residential_cover     2.814e-03  8.738e-04   3.221  0.00735 **
## Closest_Road          2.822e-05  1.194e-05   2.363  0.03586 * 
## Average_building_age  9.099e-03  2.408e-03   3.778  0.00263 **
## Area_m2              -3.733e-08  6.469e-08  -0.577  0.57452   
## Distance_m            1.355e-05  1.439e-05   0.941  0.36508   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.07366 on 12 degrees of freedom
## Multiple R-squared:  0.7813, Adjusted R-squared:  0.6902 
## F-statistic: 8.575 on 5 and 12 DF,  p-value: 0.001175
summary.lm(modelExo.signif)$sigma
## [1] 0.07365543
confint(modelExo.signif)
##                              2.5 %        97.5 %
## (Intercept)          -2.839191e+01 -7.603313e+00
## Residential_cover     9.103469e-04  4.718064e-03
## Closest_Road          2.198953e-06  5.424194e-05
## Average_building_age  3.851541e-03  1.434554e-02
## Area_m2              -1.782785e-07  1.036112e-07
## Distance_m           -1.781131e-05  4.491043e-05
(Area_AND_propEXO_plot<-jtools::effect_plot(modelExo.signif, pred=Area_m2, interval = TRUE,
  int.type = "confidence",data = TRY)+
    geom_smooth(color=c('red'), formula = y~x)+
    geom_point(aes(Area_m2,Exotic_Native_Ratio),TRY)+
    labs(x="\nArea (m^2)", y="Proportion exotic to native")+
    ylim(0,0.6)+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess'

(Dist_AND_propEXO_plot<-jtools::effect_plot(modelExo.signif, pred=Distance_m, interval = TRUE,
  int.type = "confidence",data = TRY)+
    geom_smooth(color=c('red'), formula = y~x)+
    geom_point(aes(Distance_m,Exotic_Native_Ratio),TRY)+
    labs(x="\nDistance (m)", y="")+
    ylim(0,0.6)+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess'

(Building_AND_propEXO_plot<-jtools::effect_plot(modelExo.signif, pred=Average_building_age , interval = TRUE,
  int.type = "confidence",data = TRY)+
    geom_smooth(color=c('red'))+
    geom_point(aes(Average_building_age ,Exotic_Native_Ratio),TRY)+
    labs(x="\nAvg. Year of Constuction", y="")+
    ylim(0,0.6)+
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18, angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

(Road_AND_propEXO_plot<-jtools::effect_plot(modelExo, pred=Closest_Road, interval = TRUE,
  int.type = "confidence",data = TRY)+
    geom_smooth(color=c('red'))+
    geom_point(aes(Closest_Road,Exotic_Native_Ratio),TRY)+
    labs(x="\nClosest Road (m)", y="")+
    ylim(0,0.6)+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18, angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

(Controlled_propEXO_plots<-grid.arrange(Area_AND_propEXO_plot,Dist_AND_propEXO_plot,Building_AND_propEXO_plot, Road_AND_propEXO_plot, nrow = 1))
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

## TableGrob (1 x 4) "arrange": 4 grobs
##   z     cells    name           grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## 3 3 (1-1,3-3) arrange gtable[layout]
## 4 4 (1-1,4-4) arrange gtable[layout]
ggsave("Controlled_propEXO_plots.pdf", Controlled_propEXO_plots,width = 19, height = 5)

Model Exotic and Native independently

###LRT #### Exotic

modAll3<-lm(Exotic~ Area_m2 +Distance_m +
              Commercial_cover+
                Residential_cover+
                Closest_Road+
                Average_building_age,
              data = TRY)
modAll3.d<-dredge(modAll3)
## Fixed term is "(Intercept)"
dim(modAll3.d)
## [1] 64 12
dim(subset(modAll3.d, cumsum(weight) <= .95) )
## [1] 19 12
avgmod3.95p <- model.avg(modAll3.d, cumsum(weight) <= .95)
confint(avgmod3.95p)
##                              2.5 %       97.5 %
## (Intercept)          -6.971203e+02 3.902370e+02
## Closest_Road          3.971701e-04 2.700223e-03
## Residential_cover     7.322410e-02 2.689672e-01
## Commercial_cover     -4.373788e-01 5.728961e-02
## Average_building_age -6.945090e-02 5.280615e-01
## Area_m2              -1.257737e-05 3.792542e-06
## Distance_m           -2.358516e-03 2.186925e-03
DF<-data.frame( TRY$Residential_cover, TRY$Closest_Road)
hier.part::hier.part(TRY$Exotic,DF,"gaussian")

## $gfs
## [1] 0.00000000 0.28558769 0.01589601 0.55375769
## 
## $IJ
##                               I         J      Total
## TRY.Residential_cover 0.4117247 -0.126137 0.28558769
## TRY.Closest_Road      0.1420330 -0.126137 0.01589601
## 
## $I.perc
##                       ind.exp.var
## TRY.Residential_cover    74.35106
## TRY.Closest_Road         25.64894
## 
## $params
## $params$full.model
## [1] "y ~ TRY.Residential_cover + TRY.Closest_Road"
## 
## $params$family
## [1] "gaussian"
## 
## $params$link
## [1] "default"
## 
## $params$gof
## [1] "Rsqu"
modAll3.lm<-lm(Exotic~Residential_cover+
                Closest_Road,
              data = TRY)
summary(modAll3.lm)$adj.r.squared 
## [1] 0.4942587

Native

modAll4<-lm(Native~ Area_m2 +
                     Distance_m +
              Commercial_cover+
                Residential_cover+
                Closest_Road+
                Average_building_age,
              data = TRY)
plot(modAll4)

## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced

## Warning in sqrt(crit * p * (1 - hh)/hh): NaNs produced

lmtest::bptest(modAll4)
## 
##  studentized Breusch-Pagan test
## 
## data:  modAll4
## BP = 2.8373, df = 6, p-value = 0.829
modAll4.d<-dredge(modAll4)
## Fixed term is "(Intercept)"
dim(modAll4.d)
## [1] 64 12
dim(subset(modAll4.d, cumsum(weight) <= .95) )
## [1] 31 12
avgmod4.95p <- model.avg(modAll4.d, cumsum(weight) <= .95)
confint(avgmod4.95p)
##                              2.5 %       97.5 %
## (Intercept)          -1.452386e+03 1.049575e+03
## Distance_m           -1.304899e-03 6.108806e-03
## Average_building_age -4.717770e-01 1.420527e+00
## Area_m2              -3.006897e-05 1.214050e-05
## Commercial_cover     -1.011542e+00 4.653252e-01
## Closest_Road         -2.052519e-03 4.005600e-03
## Residential_cover    -2.388505e-01 2.429632e-01
DF<-data.frame( TRY$Residential_cover, TRY$Closest_Road)
hier.part::hier.part(TRY$Exotic,DF,"gaussian")

## $gfs
## [1] 0.00000000 0.28558769 0.01589601 0.55375769
## 
## $IJ
##                               I         J      Total
## TRY.Residential_cover 0.4117247 -0.126137 0.28558769
## TRY.Closest_Road      0.1420330 -0.126137 0.01589601
## 
## $I.perc
##                       ind.exp.var
## TRY.Residential_cover    74.35106
## TRY.Closest_Road         25.64894
## 
## $params
## $params$full.model
## [1] "y ~ TRY.Residential_cover + TRY.Closest_Road"
## 
## $params$family
## [1] "gaussian"
## 
## $params$link
## [1] "default"
## 
## $params$gof
## [1] "Rsqu"
modAll4.lm<-lm(Exotic~Residential_cover+
                Closest_Road,
              data = TRY)
summary(modAll4.lm)$adj.r.squared 
## [1] 0.4942587

PLOT

####Exotic:Native#####
modelExoALONE.best<-update(modAll3.lm,.~.+Area_m2+Distance_m)
logit2prob <- function(logit){
  odds <- exp(logit)
  prob <- odds / (1 + odds)
  return(prob)
}
logit2prob(coef(modelExoALONE.best))
##       (Intercept) Residential_cover      Closest_Road           Area_m2 
##         0.8738109         0.5492324         0.5005612         0.4999987 
##        Distance_m 
##         0.4997464
logit2prob(confint(modelExoALONE.best))
##                         2.5 %    97.5 %
## (Intercept)       0.005314348 0.9998886
## Residential_cover 0.519435594 0.5786802
## Closest_Road      0.500139271 0.5009832
## Area_m2           0.499996380 0.5000009
## Distance_m        0.499281584 0.5002113
(Area_AND_EXO_plot<-jtools::effect_plot(modelExoALONE.best, pred=Area_m2, interval = TRUE,
  int.type = "confidence",data = IBT_data)+
    geom_smooth(color=c('red'), formula = y~x)+
    geom_point(aes(Area_m2,Exotic),IBT_data)+
    labs(x="\nArea (m^2)", y="Number of exotic species")+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess'

(Dist_AND_EXO_plot<-jtools::effect_plot(modelExoALONE.best, pred=Distance_m, interval = TRUE,
  int.type = "confidence",data = IBT_data)+
    geom_smooth(color=c('red'), formula = y~x)+
    geom_point(aes(Distance_m,Exotic),IBT_data)+
    labs(x="\nDistance (m)", y="Number of exotic species")+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess'

##### NATIVES #####
modelNatALONE1.best<-update(modAll4.lm,.~.+Area_m2+Distance_m)

logit2prob(coef(modelNatALONE1.best))
##       (Intercept) Residential_cover      Closest_Road           Area_m2 
##         0.8738109         0.5492324         0.5005612         0.4999987 
##        Distance_m 
##         0.4997464
logit2prob(confint(modelNatALONE1.best))
##                         2.5 %    97.5 %
## (Intercept)       0.005314348 0.9998886
## Residential_cover 0.519435594 0.5786802
## Closest_Road      0.500139271 0.5009832
## Area_m2           0.499996380 0.5000009
## Distance_m        0.499281584 0.5002113
(Area_AND_Nat_plot<-jtools::effect_plot(modelNatALONE1.best, pred=Area_m2, interval = TRUE,
  int.type = "confidence",data = IBT_data)+
    geom_smooth(color=c('red'), formula = y~x)+
    geom_point(aes(Area_m2,Native),IBT_data)+
    labs(x="\nArea (m^2)", y="Number of native species")+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess'

(Dist_AND_Nat_plot<-jtools::effect_plot(modelNatALONE1.best, pred=Distance_m, interval = TRUE,
  int.type = "confidence",data = IBT_data)+
    geom_smooth(color=c('red'), formula = y~x)+
    geom_point(aes(Distance_m,Native),IBT_data)+
    labs(x="\nDistance (m)", y="Number of native species")+
    theme_classic() +
    theme(
      axis.text = element_text(family="Times",colour = "black"),
      axis.title.x = element_text(family="Times",size=22),
      axis.text.x = element_text(family="Times",size=18,angle=90),
      axis.title.y = element_text(family="Times",size=22, angle=90), 
      axis.text.y = element_text(family="Times",size=18),
      axis.ticks = element_blank(),
      panel.background = element_rect(fill="white"),
      panel.border = element_rect(colour = "black", fill=NA, size=1),
      plot.title=element_text(face="bold", size=24)
    ))
## `geom_smooth()` using method = 'loess'

(Controlled_EXO_plots<-grid.arrange(Area_AND_EXO_plot,Dist_AND_EXO_plot, Area_AND_Nat_plot,Dist_AND_Nat_plot,  nrow = 2))
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess'
## `geom_smooth()` using method = 'loess'

## TableGrob (2 x 2) "arrange": 4 grobs
##   z     cells    name           grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (1-1,2-2) arrange gtable[layout]
## 3 3 (2-2,1-1) arrange gtable[layout]
## 4 4 (2-2,2-2) arrange gtable[layout]
ggsave("Controlled_invasion_comparison_plots.pdf",Controlled_EXO_plots, height= 15, width = 20)

H4

Forest islands within the urban core will have a greater number of exotic species than those found outside of the urban core.

Model composition to Space including Urban

Loc.TRY<-TRY
Combined.hell<-decostand(Combined,"hellinger")

formulaRDA.Tout <- rda(Combined.hell ~ Area_m2 +
                     Distance_m +
                Commercial_cover+
                Residential_cover+
                Closest_Road+
                Average_building_age,
              data = Loc.TRY)
formulaRDA.Base <- rda(Combined.hell ~ 1, data=Loc.TRY)
summary(formulaRDA.Tout)
## 
## Call:
## rda(formula = Combined.hell ~ Area_m2 + Distance_m + Commercial_cover +      Residential_cover + Closest_Road + Average_building_age,      data = Loc.TRY) 
## 
## Partitioning of variance:
##               Inertia Proportion
## Total          0.7721     1.0000
## Constrained    0.2698     0.3494
## Unconstrained  0.5023     0.6506
## 
## Eigenvalues, and their contribution to the variance 
## 
## Importance of components:
##                          RDA1    RDA2    RDA3    RDA4    RDA5    RDA6    PC1
## Eigenvalue            0.07266 0.06417 0.04977 0.03918 0.02890 0.01513 0.1527
## Proportion Explained  0.09410 0.08311 0.06446 0.05075 0.03743 0.01959 0.1978
## Cumulative Proportion 0.09410 0.17721 0.24167 0.29241 0.32985 0.34944 0.5472
##                           PC2    PC3     PC4     PC5     PC6     PC7     PC8
## Eigenvalue            0.09102 0.0620 0.04626 0.03572 0.02969 0.02534 0.02260
## Proportion Explained  0.11788 0.0803 0.05992 0.04627 0.03846 0.03282 0.02928
## Cumulative Proportion 0.66513 0.7454 0.80534 0.85161 0.89007 0.92289 0.95217
##                           PC9    PC10     PC11
## Eigenvalue            0.02158 0.01008 0.005274
## Proportion Explained  0.02795 0.01305 0.006831
## Cumulative Proportion 0.98012 0.99317 1.000000
## 
## Accumulated constrained eigenvalues
## Importance of components:
##                          RDA1    RDA2    RDA3    RDA4   RDA5    RDA6
## Eigenvalue            0.07266 0.06417 0.04977 0.03918 0.0289 0.01513
## Proportion Explained  0.26930 0.23783 0.18445 0.14523 0.1071 0.05607
## Cumulative Proportion 0.26930 0.50713 0.69158 0.83681 0.9439 1.00000
## 
## 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:  1.903406 
## 
## 
## Species scores
## 
##                                       RDA1       RDA2       RDA3       RDA4
## Acer.rubrum                     -1.605e-01  0.1669543 -4.158e-02 -0.0476137
## Amelanchier.laevis              -5.458e-02  0.0095908 -1.867e-03  0.0148300
## Apocynum.androsaemifolium        6.763e-03  0.0183175 -6.698e-03  0.0040997
## Aralia.nudicaulis               -9.950e-02  0.0919797  5.709e-03 -0.0558479
## Carex.gynandra                  -7.610e-03  0.0060368 -9.770e-03 -0.0129285
## Chamerion.angustifolium          9.181e-03  0.0080121 -5.938e-03 -0.0113884
## Cornus.canadensis                2.398e-02  0.0307520 -6.907e-02  0.0258600
## Corylus.cornuta                  7.739e-03  0.0304339 -4.138e-02 -0.0328316
## Diervilla.lonicera               1.644e-02  0.0728833 -1.014e-01 -0.0172571
## Dryopteris.intermedia            5.287e-02 -0.0038252  3.687e-02  0.0112568
## Epipactis.helleborine           -7.610e-03  0.0060368 -9.770e-03 -0.0129285
## Eurybia.macrophylla             -1.995e-02  0.0173632 -4.563e-02 -0.0878579
## Fragaria.virginiana             -4.093e-02  0.0121594 -2.834e-02 -0.0815906
## Geum.aleppicum                  -1.581e-03  0.0047003 -2.196e-02 -0.0109192
## Hylotelephium.erythrostictum    -9.321e-03  0.0073935 -1.197e-02 -0.0158341
## Hypericum.canadense             -2.028e-03  0.0158041 -5.437e-03 -0.0156748
## Lonicera.hirsuta                -9.623e-03  0.0081963 -3.524e-02 -0.0372954
## Maianthemum.canadense           -2.258e-01  0.2264545  1.040e-01  0.1084760
## Phleum.pratense                 -2.249e-03  0.0068825 -8.796e-03 -0.0128163
## Pinus.strobus                    1.591e-03  0.0021393  4.639e-03 -0.0109319
## Poa.annua                       -5.560e-02  0.0022206 -2.391e-02 -0.1699123
## Poa.compressa                   -1.229e-02 -0.0014999 -2.376e-02 -0.0292134
## Prunus.virginiana                1.330e-01  0.0284171 -1.117e-01  0.0419961
## Pteridium.aquilinum             -1.378e-01  0.0447455  9.814e-03  0.0527917
## Pyrola.elliptica                 7.670e-02  0.0289989 -1.180e-01  0.0345916
## Quercus.rubra                   -3.248e-02  0.0394797 -4.853e-03 -0.0132143
## Rubus.canadensis                -5.407e-04  0.0253152 -5.062e-02 -0.0083561
## Rubus.pubescens                  1.467e-01  0.0968053 -1.851e-01  0.0287933
## Salix.discolor                  -4.359e-03  0.0051409 -3.611e-03 -0.0142359
## Solidago.gigantea               -1.497e-02  0.0152431 -1.525e-02 -0.0390972
## Sorbus.decora                   -4.894e-02  0.0291262 -2.539e-02  0.0306499
## Taraxacum.officinale            -5.437e-03 -0.0840023 -6.565e-02 -0.0312771
## Trientalis.borealis              7.268e-03  0.0675669 -5.102e-04 -0.0142789
## Acer.saccharum                   1.348e-01 -0.0370934  1.226e-01 -0.0367069
## Fraxinus.americana              -2.615e-01 -0.2984089 -5.849e-02  0.1466080
## Mitchella.repens                -4.308e-02  0.0011208 -1.270e-02  0.0625942
## Myosotis.arvensis                1.883e-02 -0.0455853  1.525e-02  0.0038117
## Populus.balsamifera              5.867e-03  0.0077521  7.119e-03  0.0206294
## Thuja.occidentalis              -2.183e-02 -0.0033650  3.789e-03  0.0205019
## Alliaria.petiolata               1.585e-02 -0.0333438  5.234e-02 -0.0054651
## Carex.arctata                    4.123e-02 -0.0145043  5.033e-02 -0.0089476
## Carex.brunnescens                4.396e-03 -0.0092479  1.452e-02 -0.0015158
## Carex.intumescens                4.611e-02  0.0149436  3.045e-02  0.0397053
## Doellingeria.umbellata           4.260e-02  0.0163008  2.558e-02  0.0062330
## Equisetum.arvense                3.368e-02 -0.0998586  1.237e-01 -0.0417618
## Equisetum.sylvaticum             5.573e-02  0.0135701 -3.506e-03  0.0308913
## Fraxinus.nigra                   6.217e-03 -0.0130785  2.053e-02 -0.0021436
## Geum.canadense                   1.001e-01  0.0601916 -1.436e-01  0.0993055
## Maianthemum.racemosum           -1.223e-03 -0.0629718  1.580e-02 -0.0117953
## Populus.tremuloides              1.949e-02  0.0106105  1.898e-02 -0.0139405
## Potentilla.simplex               2.538e-03 -0.0053393  8.381e-03 -0.0008751
## Ranunculus.acris                 5.368e-03 -0.0603603 -3.511e-03 -0.0311727
## Rhamnus.cathartica              -7.246e-04 -0.0346942 -7.885e-04  0.0037875
## Ribes.glandulosum                2.848e-02 -0.0282157 -6.258e-02 -0.0250861
## Ribes.triste                     3.198e-02 -0.0241856  4.507e-02  0.0053405
## Rubus.idaeus                     1.503e-01 -0.0287121  1.428e-01  0.0013929
## Solanum.dulcamara                2.147e-03  0.0107713  6.375e-03 -0.0313224
## Solidago.altissima               3.528e-02  0.0056088  2.566e-02 -0.0157245
## Solidago.rugosa                 -1.476e-02 -0.0844039 -5.821e-03 -0.0542260
## Viburnum.opulus                 -2.179e-02 -0.0822137 -4.660e-02 -0.0144758
## Viburnum.opulus.1               -2.140e-02 -0.0459302 -1.794e-02 -0.0095928
## Acer.platanoides                 9.815e-03  0.0073958 -1.354e-02 -0.0014039
## Anthoxanthum.odoratum           -2.115e-03  0.0115254 -7.314e-03 -0.0134277
## Arctium.minus                   -2.115e-03  0.0115254 -7.314e-03 -0.0134277
## Brachyelytrum.aristosum         -2.115e-03  0.0115254 -7.314e-03 -0.0134277
## Carex.debilis                    2.356e-02 -0.0039920  8.308e-05  0.0009764
## Crataegus.chrysocarpa           -1.727e-03  0.0094104 -5.972e-03 -0.0109636
## Dicranum.polysetum              -1.727e-03  0.0094104 -5.972e-03 -0.0109636
## Geum.fragarioides               -1.221e-03  0.0066542 -4.223e-03 -0.0077525
## Lonicera.canadensis              1.009e-02  0.0167824 -1.276e-02 -0.0369702
## Polygonatum.pubescens           -3.454e-03  0.0188209 -1.194e-02 -0.0219273
## Trillium.cernuum                -6.890e-03 -0.0242009 -2.846e-02 -0.0269347
## Viola.sororia                   -1.727e-03  0.0094104 -5.972e-03 -0.0109636
## Carex.gracillima                 1.889e-02 -0.0271936 -1.756e-02  0.0083809
## Galeopsis.tetrahit               3.222e-02  0.0031954  1.407e-02  0.0212006
## Geum.macrophyllum                8.380e-03 -0.0313935 -2.510e-02  0.0063086
## Impatiens.capensis               1.315e-01  0.0125915  5.747e-02  0.0859239
## Oxalis.stricta                   1.239e-02  0.0069156  5.034e-03  0.0158275
## Ulmus.americana                  8.763e-03  0.0048901  3.560e-03  0.0111917
## Geranium.bicknellii             -7.212e-03 -0.0113248 -1.561e-03  0.0023839
## Ribes.lacustre                  -1.619e-02 -0.0274957  5.195e-03 -0.0081012
## Symphyotrichum.lateriflorum     -7.595e-03 -0.0476084 -3.022e-02 -0.0024992
## Calamagrostis.canadensis         6.733e-02 -0.0014540  4.042e-02  0.0087931
## Dryopteris.cristata              7.071e-03 -0.0005110  3.170e-03  0.0030178
## Equisetum.pratense               5.446e-03 -0.1544490 -1.184e-01 -0.0176993
## Galium.asprellum                 7.071e-03 -0.0005110  3.170e-03  0.0030178
## Juncus.effusus                   7.071e-03 -0.0005110  3.170e-03  0.0030178
## Lonicera.x.bella                 7.071e-03 -0.0005110  3.170e-03  0.0030178
## Onoclea.sensibilis               1.429e-02 -0.0028003  1.292e-02 -0.0010684
## Phalaris.arundinacea             3.937e-02 -0.0028450  1.765e-02  0.0168023
## Ribes.cynosbati                  7.071e-03 -0.0005110  3.170e-03  0.0030178
## Thalictrum.pubescens             1.581e-02 -0.0011426  7.088e-03  0.0067480
## Fallopia.cilinodis               9.165e-03  0.0006464 -6.940e-03 -0.0035501
## Hesperis.matronalis              2.049e-02  0.0014454 -1.552e-02 -0.0079383
## Ribes.hirtellum                  3.267e-02  0.0051889 -1.006e-02 -0.0295935
## Vinca.minor                      1.296e-02  0.0009141 -9.815e-03 -0.0050206
## Acer.spicatum                    1.038e-02  0.0093633 -2.198e-02  0.0123750
## Dryopteris.carthusiana          -1.069e-02  0.0390423 -2.305e-02  0.0243920
## Sambucus.racemosa.ssp..pubens    1.038e-02  0.0093633 -2.198e-02  0.0123750
## Abies.balsamea                  -7.667e-03 -0.0148255 -8.831e-03 -0.0526971
## Agrimonia.gryposepala           -4.282e-04 -0.0405662 -3.204e-02 -0.0054594
## Hieracium.gronovii              -4.062e-04 -0.0384845 -3.039e-02 -0.0051793
## Linnaea.borealis                -1.354e-04 -0.0128282 -1.013e-02 -0.0017264
## Poa.pratensis                   -1.354e-04 -0.0128282 -1.013e-02 -0.0017264
## Rosa.multiflora                 -2.345e-04 -0.0222190 -1.755e-02 -0.0029903
## Solidago.canadensis              1.536e-03 -0.0207083 -1.184e-02 -0.0118135
## Tilia.americana                 -1.354e-04 -0.0128282 -1.013e-02 -0.0017264
## Clintonia.borealis              -5.404e-03  0.0258940  3.615e-02  0.0085410
## Coptis.trifolia                 -2.360e-02  0.0273113  1.374e-02 -0.0019321
## Huperzia.lucidula               -2.197e-02  0.0223440  6.952e-03  0.0059679
## Lycopodium.dendroideum          -2.197e-02  0.0223440  6.952e-03  0.0059679
## Picea.glauca                    -1.236e-02  0.0209178  1.142e-02  0.0082318
## Agrostis.gigantea                4.903e-03  0.0041830  1.581e-02 -0.0244304
## Alnus.incana.ssp..rugosa         1.022e-03  0.0008722  3.297e-03 -0.0050941
## Cirsium.arvense                  1.022e-03  0.0008722  3.297e-03 -0.0050941
## Cornus.stolonifera               1.446e-03  0.0012335  4.663e-03 -0.0072041
## Erigeron.strigosus              -6.226e-03  0.0005766  8.428e-04 -0.0282993
## Platanthera.psycodes            -5.204e-03  0.0014488  4.140e-03 -0.0333934
## Solidago.hispida                 2.045e-03  0.0017444  6.595e-03 -0.0101882
## Symphyotrichum.puniceum          1.022e-03  0.0008722  3.297e-03 -0.0050941
## Trifolium.pratense               1.446e-03  0.0012335  4.663e-03 -0.0072041
## Veronica.serpyllifolia           1.446e-03  0.0012335  4.663e-03 -0.0072041
## Viburnum.opulus.var..americanum  1.022e-03  0.0008722  3.297e-03 -0.0050941
## Viola.blanda                     1.022e-03  0.0008722  3.297e-03 -0.0050941
## Arisaema.triphyllum              1.758e-04 -0.0021780  8.054e-03 -0.0087006
## Cornus.alternifolia              7.175e-05 -0.0008892  3.288e-03 -0.0035520
## Fragaria.vesca                   1.435e-04 -0.0017783  6.576e-03 -0.0071040
## Gymnocarpium.dryopteris          6.214e-04 -0.0077003  2.848e-02 -0.0307612
## Heracleum.maximum                1.243e-04 -0.0015401  5.695e-03 -0.0061522
## Matteuccia.struthiopteris        3.930e-04 -0.0048701  1.801e-02 -0.0194551
## Taxus.canadensis                -7.105e-03 -0.0020739  4.122e-03 -0.0303092
## Thelypteris.noveboracensis       1.435e-04 -0.0017783  6.576e-03 -0.0071040
## Trillium.grandiflorum           -1.248e-02 -0.0014012 -9.632e-04 -0.0437446
## Athyrium.filix.femina           -4.288e-02 -0.0017489 -1.452e-02 -0.1372839
## Phegopteris.connectilis         -3.624e-02 -0.0014781 -1.227e-02 -0.1160261
## Anaphalis.margaritacea           1.850e-02  0.0088687  1.905e-02  0.0111405
## Dichanthelium.acuminatum         2.732e-02  0.0131000  2.814e-02  0.0164557
## Pilosella.aurantiaca             1.577e-02  0.0075633  1.624e-02  0.0095007
## Pilosella.piloselloides          3.657e-02  0.0175347  3.766e-02  0.0220264
## Prunus.pensylvanica              9.659e-03  0.0046315  9.947e-03  0.0058180
## Shepherdia.canadensis            5.577e-03  0.0026740  5.743e-03  0.0033590
## Oryzopsis.asperifolia            1.394e-02 -0.0042588  2.309e-02 -0.0035801
##                                       RDA5       RDA6
## Acer.rubrum                     -3.783e-02 -0.0943029
## Amelanchier.laevis               5.508e-03 -0.0036915
## Apocynum.androsaemifolium        4.964e-02  0.0023883
## Aralia.nudicaulis               -1.268e-02 -0.0849465
## Carex.gynandra                   1.135e-02  0.0048966
## Chamerion.angustifolium          1.336e-02  0.0031716
## Cornus.canadensis               -4.075e-02  0.0190357
## Corylus.cornuta                 -5.051e-03  0.0284077
## Diervilla.lonicera               9.595e-05  0.0465093
## Dryopteris.intermedia            4.487e-02 -0.0048195
## Epipactis.helleborine            1.135e-02  0.0048966
## Eurybia.macrophylla              2.381e-02  0.0190153
## Fragaria.virginiana              3.907e-02  0.0273163
## Geum.aleppicum                   7.920e-02  0.0028466
## Hylotelephium.erythrostictum     1.390e-02  0.0059971
## Hypericum.canadense              2.845e-02  0.0099794
## Lonicera.hirsuta                 1.895e-02  0.0062493
## Maianthemum.canadense            2.093e-02  0.0426294
## Phleum.pratense                  1.237e-02  0.0044735
## Pinus.strobus                   -4.813e-04  0.0052796
## Poa.annua                        2.589e-03  0.0546593
## Poa.compressa                    1.350e-02  0.0020286
## Prunus.virginiana                1.267e-01 -0.0210267
## Pteridium.aquilinum             -6.688e-03 -0.0181372
## Pyrola.elliptica                -1.279e-01  0.0383193
## Quercus.rubra                    2.277e-03 -0.0288428
## Rubus.canadensis                -1.694e-03  0.0175798
## Rubus.pubescens                  7.175e-02  0.0171446
## Salix.discolor                   4.477e-03  0.0050693
## Solidago.gigantea                1.828e-02  0.0141628
## Sorbus.decora                   -1.068e-02  0.0309839
## Taraxacum.officinale             1.703e-02 -0.0199860
## Trientalis.borealis             -1.185e-01 -0.0230508
## Acer.saccharum                   2.781e-02  0.0200199
## Fraxinus.americana               3.150e-02  0.0560833
## Mitchella.repens                -2.176e-02  0.0556842
## Myosotis.arvensis               -3.325e-02  0.0150342
## Populus.balsamifera              4.209e-03  0.0333803
## Thuja.occidentalis              -1.845e-03  0.0204852
## Alliaria.petiolata              -4.118e-02  0.0027723
## Carex.arctata                   -6.170e-02  0.0180980
## Carex.brunnescens               -1.142e-02  0.0007689
## Carex.intumescens                5.405e-02 -0.0078802
## Doellingeria.umbellata           2.186e-02  0.0020904
## Equisetum.arvense               -9.018e-02  0.0086431
## Equisetum.sylvaticum            -9.406e-03  0.0087257
## Fraxinus.nigra                  -1.615e-02  0.0010874
## Geum.canadense                  -1.454e-01  0.0386063
## Maianthemum.racemosum            1.092e-02 -0.0104438
## Populus.tremuloides              2.035e-02 -0.0164325
## Potentilla.simplex              -6.595e-03  0.0004439
## Ranunculus.acris                -2.526e-02 -0.0166478
## Rhamnus.cathartica              -4.402e-03 -0.0119012
## Ribes.glandulosum               -3.752e-02 -0.0086649
## Ribes.triste                    -3.256e-02 -0.0026871
## Rubus.idaeus                    -2.980e-02  0.0021752
## Solanum.dulcamara               -9.679e-04  0.0171768
## Solidago.altissima              -1.604e-02  0.0063041
## Solidago.rugosa                 -2.362e-02 -0.0117975
## Viburnum.opulus                  3.399e-03 -0.0322010
## Viburnum.opulus.1                1.077e-02 -0.0094057
## Acer.platanoides                 2.996e-02 -0.0027136
## Anthoxanthum.odoratum            7.629e-03  0.0074076
## Arctium.minus                    7.629e-03  0.0074076
## Brachyelytrum.aristosum          7.629e-03  0.0074076
## Carex.debilis                    2.117e-02 -0.0066374
## Crataegus.chrysocarpa            6.229e-03  0.0060483
## Dicranum.polysetum               6.229e-03  0.0060483
## Geum.fragarioides                4.405e-03  0.0042768
## Lonicera.canadensis             -2.546e-02  0.0265116
## Polygonatum.pubescens            1.246e-02  0.0120966
## Trillium.cernuum                 1.928e-02 -0.0043700
## Viola.sororia                    6.229e-03  0.0060483
## Carex.gracillima                 1.963e-02 -0.0259314
## Galeopsis.tetrahit               1.173e-02 -0.0073212
## Geum.macrophyllum                9.426e-03 -0.0250636
## Impatiens.capensis               4.635e-02 -0.0298509
## Oxalis.stricta                   2.375e-02 -0.0032078
## Ulmus.americana                  1.680e-02 -0.0022683
## Geranium.bicknellii              4.473e-03 -0.0019532
## Ribes.lacustre                   1.803e-03 -0.0006228
## Symphyotrichum.lateriflorum     -2.897e-03 -0.0247485
## Calamagrostis.canadensis        -2.654e-02 -0.0079179
## Dryopteris.cristata             -1.528e-03 -0.0015235
## Equisetum.pratense              -3.280e-02 -0.0982359
## Galium.asprellum                -1.528e-03 -0.0015235
## Juncus.effusus                  -1.528e-03 -0.0015235
## Lonicera.x.bella                -1.528e-03 -0.0015235
## Onoclea.sensibilis               2.107e-03  0.0004475
## Phalaris.arundinacea            -8.508e-03 -0.0084825
## Ribes.cynosbati                 -1.528e-03 -0.0015235
## Thalictrum.pubescens            -3.417e-03 -0.0034067
## Fallopia.cilinodis               1.230e-02 -0.0043459
## Hesperis.matronalis              2.750e-02 -0.0097177
## Ribes.hirtellum                  2.610e-02 -0.0079493
## Vinca.minor                      1.739e-02 -0.0061460
## Acer.spicatum                   -1.724e-02  0.0055060
## Dryopteris.carthusiana          -3.636e-02 -0.0305669
## Sambucus.racemosa.ssp..pubens   -1.724e-02  0.0055060
## Abies.balsamea                  -5.872e-03  0.0064032
## Agrimonia.gryposepala           -8.241e-03 -0.0254859
## Hieracium.gronovii              -7.818e-03 -0.0241781
## Linnaea.borealis                -2.606e-03 -0.0080594
## Poa.pratensis                   -2.606e-03 -0.0080594
## Rosa.multiflora                 -4.514e-03 -0.0139592
## Solidago.canadensis             -1.066e-02 -0.0111761
## Tilia.americana                 -2.606e-03 -0.0080594
## Clintonia.borealis              -2.049e-02 -0.0341466
## Coptis.trifolia                 -1.812e-02 -0.0355703
## Huperzia.lucidula               -1.037e-02 -0.0332151
## Lycopodium.dendroideum          -1.037e-02 -0.0332151
## Picea.glauca                    -4.069e-03 -0.0263709
## Agrostis.gigantea               -1.701e-02  0.0077063
## Alnus.incana.ssp..rugosa        -3.547e-03  0.0016069
## Cirsium.arvense                 -3.547e-03  0.0016069
## Cornus.stolonifera              -5.016e-03  0.0022725
## Erigeron.strigosus              -4.331e-03  0.0089965
## Platanthera.psycodes            -7.879e-03  0.0106034
## Solidago.hispida                -7.094e-03  0.0032137
## Symphyotrichum.puniceum         -3.547e-03  0.0016069
## Trifolium.pratense              -5.016e-03  0.0022725
## Veronica.serpyllifolia          -5.016e-03  0.0022725
## Viburnum.opulus.var..americanum -3.547e-03  0.0016069
## Viola.blanda                    -3.547e-03  0.0016069
## Arisaema.triphyllum              6.324e-03  0.0042799
## Cornus.alternifolia              2.582e-03  0.0017473
## Fragaria.vesca                   5.163e-03  0.0034946
## Gymnocarpium.dryopteris          2.236e-02  0.0151318
## Heracleum.maximum                4.472e-03  0.0030264
## Matteuccia.struthiopteris        1.414e-02  0.0095702
## Taxus.canadensis                 4.379e-03  0.0108842
## Thelypteris.noveboracensis       5.163e-03  0.0034946
## Trillium.grandiflorum            1.223e-03  0.0145465
## Athyrium.filix.femina           -4.640e-03  0.0437176
## Phegopteris.connectilis         -3.922e-03  0.0369482
## Anaphalis.margaritacea           1.459e-02  0.0024846
## Dichanthelium.acuminatum         2.155e-02  0.0036700
## Pilosella.aurantiaca             1.244e-02  0.0021189
## Pilosella.piloselloides          2.884e-02  0.0049124
## Prunus.pensylvanica              7.618e-03  0.0012975
## Shepherdia.canadensis            4.398e-03  0.0007491
## Oryzopsis.asperifolia           -1.701e-02  0.0036344
## 
## 
## Site scores (weighted sums of species scores)
## 
##           RDA1      RDA2     RDA3     RDA4     RDA5     RDA6
## row1  -0.46394  0.705955 -0.45038 -0.30403  0.33964 -0.12472
## row2  -0.98393 -0.029795  0.26833  0.96514  0.05079  0.76732
## row3   0.38925 -0.510518  0.61557 -0.07388 -0.97467 -0.05578
## row4   0.26177  0.001821 -0.62031 -0.33798  0.40185 -0.16894
## row5   0.76272  0.140617 -0.46959  0.41871  1.09997 -0.33079
## row6  -0.57901 -1.315110 -0.23718  0.42731  0.21073  0.17589
## row7   0.86009 -0.281698  0.41354  0.31376 -0.32099 -0.49435
## row8   0.22336  0.178866  0.41795  0.20042  0.61158  0.03266
## row9   0.45812  0.505036 -1.16490  0.54772 -1.04618  0.57900
## row10  0.02571 -1.066134 -1.00862 -0.01085  0.08149 -1.24274
## row11 -0.86291  0.878435  0.29068  0.23427 -0.41570 -1.28564
## row12  0.22336  0.178866  0.41795  0.20042  0.61158  0.03266
## row13  0.36785 -0.256663 -0.29693 -0.44033  0.09462  0.08863
## row14  0.31038 -0.313831  0.48150 -0.34896  0.21278  0.10695
## row15 -0.42128  0.268574  0.02954 -1.11694 -0.44452  0.78274
## row16 -0.27014  0.499394  0.57493  0.47511  0.25945  0.34045
## row17 -0.42128  0.268574  0.02954 -1.11694 -0.44452  0.78274
## row18  0.11990  0.147612  0.70837 -0.03295 -0.32791  0.01391
## 
## 
## Site constraints (linear combinations of constraining variables)
## 
##            RDA1     RDA2     RDA3     RDA4      RDA5     RDA6
## row1  -0.333154  0.26427 -0.42771 -0.56596  0.496736  0.21435
## row2  -1.034000 -0.15942  0.17949  0.97130 -0.087392  0.97051
## row3   0.213293 -0.44868  0.70430 -0.07354 -0.554186  0.03730
## row4  -0.076497  0.41686 -0.26453 -0.48567  0.275931  0.26793
## row5   0.485640  0.27101  0.19729  0.62025  0.930899 -0.12571
## row6  -0.507971 -0.79770 -0.10997  0.16791  0.315104 -0.13758
## row7   0.636364 -0.04598  0.28527  0.27158 -0.137508 -0.13710
## row8   0.281159 -0.40638 -0.26446  0.28918  0.552574 -0.48394
## row9   0.533179  0.48094 -1.12886  0.63563 -0.885768  0.28281
## row10 -0.010078 -0.95474 -0.75405 -0.12849 -0.193945 -0.59982
## row11 -0.851059  0.86558  0.26932  0.23119 -0.401758 -1.28672
## row12  0.126870  0.43516 -0.04451 -0.44723 -0.005111  0.29046
## row13  0.072863  0.06216  0.23500 -0.36307 -0.252807  0.11452
## row14  0.003767 -0.04668  0.17263 -0.18649  0.135545  0.09173
## row15 -0.230942 -0.26712  0.08082 -0.69925 -0.405272  0.16485
## row16  0.409100  0.19616  0.42131  0.24641  0.322661  0.05496
## row17 -0.107419  0.25332 -0.19539 -0.38393  0.368659  0.18009
## row18  0.388886 -0.11877  0.64405 -0.09984 -0.474362  0.10135
## 
## 
## Biplot scores for constraining variables
## 
##                          RDA1    RDA2    RDA3    RDA4      RDA5     RDA6
## Area_m2               0.33197 -0.2453 -0.7515  0.3729 -0.298591 -0.19125
## Distance_m           -0.12276  0.4867  0.1798  0.1634 -0.572518  0.60106
## Commercial_cover     -0.45914  0.4700  0.1510  0.1173 -0.223043 -0.69422
## Residential_cover    -0.07162  0.5062  0.1311 -0.8261  0.001646  0.19741
## Closest_Road         -0.27321 -0.1192 -0.4642  0.6525 -0.342992  0.39023
## Average_building_age  0.39750  0.2259 -0.2428 -0.1188  0.845072 -0.06109
screeplot(formulaRDA.Tout)

vif.cca(formulaRDA.Tout)
##              Area_m2           Distance_m     Commercial_cover 
##             2.126039             3.288523             1.166957 
##    Residential_cover         Closest_Road Average_building_age 
##             2.878511             4.323465             1.750137
anova.cca(formulaRDA.Tout, step=1000)
## Permutation test for rda under reduced model
## Permutation: free
## Number of permutations: 999
## 
## Model: rda(formula = Combined.hell ~ Area_m2 + Distance_m + Commercial_cover + Residential_cover + Closest_Road + Average_building_age, data = Loc.TRY)
##          Df Variance      F Pr(>F)
## Model     6   0.2698 0.9847  0.534
## Residual 11   0.5023
formulaRDA.Sel<-ordiR2step(formulaRDA.Base,scope=formula(formulaRDA.Tout))
## Step: R2.adj= 0 
## Call: Combined.hell ~ 1 
##  
##                          R2.adjusted
## + Area_m2               0.0043188471
## <none>                  0.0000000000
## + Residential_cover    -0.0005729516
## <All variables>        -0.0054122883
## + Commercial_cover     -0.0075985264
## + Closest_Road         -0.0082197582
## + Average_building_age -0.0089151419
## + Distance_m           -0.0158690352
formulaRDA.Sel
## Call: rda(formula = Combined.hell ~ 1, data = Loc.TRY)
## 
##               Inertia Rank
## Total          0.7721     
## Unconstrained  0.7721   15
## Inertia is variance 
## 
## Eigenvalues for unconstrained axes:
##     PC1     PC2     PC3     PC4     PC5     PC6     PC7     PC8     PC9    PC10 
## 0.17527 0.11087 0.08243 0.07889 0.06438 0.04593 0.03847 0.03433 0.03150 0.02603 
##    PC11    PC12    PC13    PC14    PC15 
## 0.02395 0.02043 0.01694 0.01368 0.00901
plot(formulaRDA.Sel)

# Testing the significance of terms (environmental variables):
anova.cca(formulaRDA.Sel, by="terms")
## No constrained component
## 
## Model: rda(formula = Combined.hell ~ 1, data = Loc.TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.77211
# Testing the significance of CCA axes (at least the first two or three should present a significant p value):
anova.cca(formulaRDA.Sel, by="axis")
## No constrained component
## 
## Model: rda(formula = Combined.hell ~ 1, data = Loc.TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.77211
(R2adj <- RsquareAdj(formulaRDA.Sel)$adj.r.squared)
## numeric(0)
object.xy<-Loc.TRY[,c(2,3)]
mso(formulaRDA.Tout, object.xy, grain=10000)
## Warning in dist(xy): NAs introduced by coercion
## Call: mso(object.cca = formulaRDA.Tout, object.xy = object.xy, grain =
## 10000)
## 
##               Inertia Proportion Rank
## Total          0.7721     1.0000     
## Constrained    0.2698     0.3494    6
## Unconstrained  0.5023     0.6506   11
## Inertia is variance 
## 
## Eigenvalues for constrained axes:
##    RDA1    RDA2    RDA3    RDA4    RDA5    RDA6 
## 0.07266 0.06417 0.04977 0.03918 0.02890 0.01513 
## 
## Eigenvalues for unconstrained axes:
##     PC1     PC2     PC3     PC4     PC5     PC6     PC7     PC8     PC9    PC10 
## 0.15273 0.09102 0.06200 0.04626 0.03572 0.02969 0.02534 0.02260 0.02158 0.01008 
##    PC11 
## 0.00527 
## 
## mso variogram:
## 
##   H  Dist   n     All     Sum      CA     CCA        se
## 0 0 8.957 153 0.04542 0.04542 0.02955 0.01587 0.0009335
msoplot(mso(formulaRDA.Tout, object.xy, grain=1500), alpha = 0.05)
## Warning in dist(xy): NAs introduced by coercion

Model Native species composition to Space include Urban

# Same but just for natives
Combined_native.hell<-as.data.frame(decostand(Combined_native,"hellinger"))

formulaRDA.nat.URB <- rda(Combined_native.hell ~  Area_m2 + 
              Distance_m +
              Closest_Road+
                Commercial_cover+
                Residential_cover+
                Average_building_age,data=TRY)
formulaRDA.nat.URB.NULL <- rda(Combined_native.hell ~ 1, data=TRY)
anova(formulaRDA.nat.URB)
## Permutation test for rda under reduced model
## Permutation: free
## Number of permutations: 999
## 
## Model: rda(formula = Combined_native.hell ~ Area_m2 + Distance_m + Closest_Road + Commercial_cover + Residential_cover + Average_building_age, data = TRY)
##          Df Variance      F Pr(>F)
## Model     6  0.24343 0.8599  0.802
## Residual 11  0.51900
step.res2<-ordistep(formulaRDA.nat.URB, direction="both", pstep=1000)
## 
## Start: Combined_native.hell ~ Area_m2 + Distance_m + Closest_Road +      Commercial_cover + Residential_cover + Average_building_age 
## 
##                        Df     AIC      F Pr(>F)
## - Commercial_cover      1 0.57195 0.8938  0.655
## - Closest_Road          1 0.62815 0.9310  0.580
## - Average_building_age  1 0.67583 0.9626  0.575
## - Distance_m            1 0.67959 0.9651  0.525
## - Area_m2               1 0.78266 1.0338  0.490
## - Residential_cover     1 0.73339 1.0009  0.435
## 
## Step: Combined_native.hell ~ Area_m2 + Distance_m + Closest_Road +      Residential_cover + Average_building_age 
## 
##                    Df    AIC      F Pr(>F)
## + Commercial_cover  1 1.1658 0.8938  0.585
## 
##                        Df       AIC      F Pr(>F)
## - Closest_Road          1 -0.226927 0.8281  0.680
## - Average_building_age  1 -0.175438 0.8648  0.610
## - Distance_m            1 -0.024062 0.9735  0.495
## - Residential_cover     1  0.004389 0.9940  0.425
## - Area_m2               1  0.089805 1.0558  0.345
## 
## Step: Combined_native.hell ~ Area_m2 + Distance_m + Residential_cover +      Average_building_age 
## 
##                    Df     AIC      F Pr(>F)
## + Closest_Road      1 0.57195 0.8281  0.555
## + Commercial_cover  1 0.62815 0.7881  0.695
## 
##                        Df      AIC      F Pr(>F)
## - Residential_cover     1 -1.22187 0.7465  0.750
## - Average_building_age  1 -1.04952 0.8788  0.585
## - Distance_m            1 -0.94604 0.9588  0.520
## - Area_m2               1 -0.75645 1.1066  0.265
## 
## Step: Combined_native.hell ~ Area_m2 + Distance_m + Average_building_age 
## 
##                     Df       AIC      F Pr(>F)
## + Residential_cover  1 -0.226927 0.7465  0.705
## + Commercial_cover   1 -0.296421 0.7997  0.730
## + Closest_Road       1  0.004389 0.5710  0.875
## 
##                        Df     AIC      F Pr(>F)
## - Average_building_age  1 -2.0665 0.9281  0.525
## - Distance_m            1 -1.9830 0.9975  0.495
## - Area_m2               1 -1.8484 1.1100  0.270
## 
## Step: Combined_native.hell ~ Area_m2 + Distance_m 
## 
##                        Df      AIC      F Pr(>F)
## + Average_building_age  1 -1.22187 0.9281  0.585
## + Residential_cover     1 -1.04952 0.7858  0.680
## + Closest_Road          1 -0.83921 0.6141  0.820
## + Commercial_cover      1 -0.94603 0.7011  0.845
## 
##              Df     AIC      F Pr(>F)
## - Distance_m  1 -3.1095 0.8190  0.650
## - Area_m2     1 -2.8323 1.0646  0.395
## 
## Step: Combined_native.hell ~ Area_m2 
## 
##                        Df     AIC      F Pr(>F)
## + Distance_m            1 -2.0665 0.8190  0.630
## + Residential_cover     1 -2.0533 0.8075  0.710
## + Average_building_age  1 -1.9830 0.7458  0.725
## + Commercial_cover      1 -1.9557 0.7220  0.855
## + Closest_Road          1 -1.9331 0.7023  0.880
## 
##           Df     AIC      F Pr(>F)
## - Area_m2  1 -3.9112 1.1015  0.295
## 
## Step: Combined_native.hell ~ 1 
## 
##                        Df     AIC      F Pr(>F)
## + Area_m2               1 -3.1095 1.1015  0.315
## + Distance_m            1 -2.8323 0.8401  0.650
## + Residential_cover     1 -2.7160 0.7316  0.775
## + Average_building_age  1 -2.7180 0.7335  0.780
## + Commercial_cover      1 -2.7843 0.7953  0.860
## + Closest_Road          1 -2.5589 0.5862  0.915
## 
##                        Df     AIC      F Pr(>F)
## + Area_m2               1 -3.1095 1.1015  0.330
## + Distance_m            1 -2.8323 0.8401  0.610
## + Residential_cover     1 -2.7160 0.7316  0.755
## + Average_building_age  1 -2.7180 0.7335  0.795
## + Commercial_cover      1 -2.7843 0.7953  0.805
## + Closest_Road          1 -2.5589 0.5862  0.935
#vif.cca(step.res2)
step.res2
## Call: rda(formula = Combined_native.hell ~ 1, data = TRY)
## 
##               Inertia Rank
## Total          0.7624     
## Unconstrained  0.7624   15
## Inertia is variance 
## 
## Eigenvalues for unconstrained axes:
##     PC1     PC2     PC3     PC4     PC5     PC6     PC7     PC8     PC9    PC10 
## 0.19539 0.11563 0.08449 0.06761 0.05697 0.04389 0.04086 0.03868 0.02633 0.02286 
##    PC11    PC12    PC13    PC14    PC15 
## 0.01981 0.01806 0.01342 0.01089 0.00754
# Testing the significance of the CCA model:
anova.cca(step.res2)
## No constrained component
## 
## Model: rda(formula = Combined_native.hell ~ 1, data = TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.76243
# Testing the significance of terms (environmental variables):
anova.cca(step.res2, by="terms")
## No constrained component
## 
## Model: rda(formula = Combined_native.hell ~ 1, data = TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.76243
# Testing the significance of CCA axes (at least the first two or three should present a significant p value):
anova.cca(step.res2, by="axis")
## No constrained component
## 
## Model: rda(formula = Combined_native.hell ~ 1, data = TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.76243
(R2adj2 <- RsquareAdj(step.res2)$adj.r.squared)
## numeric(0)

Model Invasive species composition to Space include Urban

# Same but jsut for invasives
Combined_invasive.hell<-decostand(Combined_invasive,"hellinger")

formulaRDA.inv.URB <- rda(Combined_invasive.hell~  Area_m2 + 
              Distance_m +
              Closest_Road+
                Commercial_cover+
                Residential_cover+
                Average_building_age, data=TRY)


formulaRDA.inv.URB.NULL <- rda(Combined_invasive.hell ~ 1, data=TRY)
anova(formulaRDA.inv.URB)
## Permutation test for rda under reduced model
## Permutation: free
## Number of permutations: 999
## 
## Model: rda(formula = Combined_invasive.hell ~ Area_m2 + Distance_m + Closest_Road + Commercial_cover + Residential_cover + Average_building_age, data = TRY)
##          Df Variance      F Pr(>F)
## Model     6  0.28100 1.1957  0.169
## Residual 11  0.43084
step.res3<-ordistep(formulaRDA.inv.URB, direction="both", pstep=1000)
## 
## Start: Combined_invasive.hell ~ Area_m2 + Distance_m + Closest_Road +      Commercial_cover + Residential_cover + Average_building_age 
## 
##                        Df     AIC      F Pr(>F)  
## - Commercial_cover      1 -3.6783 0.3141  0.965  
## - Area_m2               1 -2.1810 1.2955  0.210  
## - Residential_cover     1 -1.9634 1.4451  0.160  
## - Average_building_age  1 -1.3759 1.8580  0.045 *
## - Distance_m            1 -1.2360 1.9583  0.035 *
## - Closest_Road          1 -1.2170 1.9720  0.030 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Step: Combined_invasive.hell ~ Area_m2 + Distance_m + Closest_Road +      Residential_cover + Average_building_age 
## 
##                    Df     AIC      F Pr(>F)
## + Commercial_cover  1 -2.1851 0.3141   0.88
## 
##                        Df     AIC      F Pr(>F)  
## - Area_m2               1 -3.7379 1.3659  0.205  
## - Residential_cover     1 -3.5095 1.5366  0.155  
## - Average_building_age  1 -2.9530 1.9617  0.030 *
## - Distance_m            1 -2.8165 2.0679  0.025 *
## - Closest_Road          1 -2.6991 2.1599  0.020 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Step: Combined_invasive.hell ~ Distance_m + Closest_Road + Residential_cover +      Average_building_age 
## 
##                    Df     AIC      F Pr(>F)
## + Area_m2           1 -3.6783 1.3659   0.18
## + Commercial_cover  1 -2.1810 0.2991   0.97
## 
##                        Df     AIC      F Pr(>F)  
## - Residential_cover     1 -3.7266 1.5368  0.125  
## - Distance_m            1 -3.6659 1.5860  0.125  
## - Closest_Road          1 -3.3331 1.8581  0.040 *
## - Average_building_age  1 -3.0738 2.0738  0.015 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Step: Combined_invasive.hell ~ Distance_m + Closest_Road + Average_building_age 
## 
##                     Df     AIC      F Pr(>F)
## + Residential_cover  1 -3.7379 1.5368   0.12
## + Area_m2            1 -3.5095 1.3535   0.23
## + Commercial_cover   1 -2.1274 0.2927   0.96
## 
##                        Df     AIC      F Pr(>F)  
## - Distance_m            1 -4.5781 0.9225  0.480  
## - Closest_Road          1 -3.5310 1.8162  0.070 .
## - Average_building_age  1 -3.4858 1.8560  0.045 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Step: Combined_invasive.hell ~ Closest_Road + Average_building_age 
## 
##                     Df     AIC      F Pr(>F)
## + Distance_m         1 -3.7266 0.9225   0.54
## + Residential_cover  1 -3.6659 0.8722   0.58
## + Area_m2            1 -3.4205 0.6708   0.76
## + Commercial_cover   1 -2.9355 0.2808   0.96
## 
##                        Df     AIC      F Pr(>F)  
## - Closest_Road          1 -4.8554 1.5065  0.120  
## - Average_building_age  1 -4.5491 1.7898  0.045 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Step: Combined_invasive.hell ~ Average_building_age 
## 
##                     Df     AIC      F Pr(>F)
## + Closest_Road       1 -4.5781 1.5065  0.120
## + Residential_cover  1 -4.5288 1.4614  0.120
## + Area_m2            1 -4.2581 1.2157  0.265
## + Distance_m         1 -3.5310 0.5737  0.885
## + Commercial_cover   1 -3.1916 0.2828  0.955
## 
##                        Df     AIC      F Pr(>F)
## - Average_building_age  1 -5.1472 1.5928  0.115
## 
## Step: Combined_invasive.hell ~ 1 
## 
##                        Df     AIC      F Pr(>F)  
## + Average_building_age  1 -4.8554 1.5928  0.090 .
## + Closest_Road          1 -4.5491 1.2960  0.140  
## + Residential_cover     1 -4.6870 1.4290  0.185  
## + Area_m2               1 -4.3795 1.1338  0.325  
## + Commercial_cover      1 -3.4973 0.3143  0.930  
## + Distance_m            1 -3.4338 0.2568  0.990  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                        Df     AIC      F Pr(>F)
## + Average_building_age  1 -4.8554 1.5928  0.120
## + Residential_cover     1 -4.6870 1.4290  0.175
## + Closest_Road          1 -4.5491 1.2960  0.200
## + Area_m2               1 -4.3795 1.1338  0.290
## + Commercial_cover      1 -3.4973 0.3143  0.925
## + Distance_m            1 -3.4338 0.2568  0.995
step.res3
## Call: rda(formula = Combined_invasive.hell ~ 1, data = TRY)
## 
##               Inertia Rank
## Total          0.7118     
## Unconstrained  0.7118   14
## Inertia is variance 
## 
## Eigenvalues for unconstrained axes:
##     PC1     PC2     PC3     PC4     PC5     PC6     PC7     PC8     PC9    PC10 
## 0.17467 0.14198 0.10118 0.07692 0.05550 0.04519 0.03954 0.02114 0.01670 0.01298 
##    PC11    PC12    PC13    PC14 
## 0.01118 0.00805 0.00416 0.00264
# Testing the significance of the CCA model:
anova.cca(step.res3)
## No constrained component
## 
## Model: rda(formula = Combined_invasive.hell ~ 1, data = TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.71184
# Testing the significance of terms (environmental variables):
anova.cca(step.res3, by="terms")
## No constrained component
## 
## Model: rda(formula = Combined_invasive.hell ~ 1, data = TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.71184
# Testing the significance of CCA axes (at least the first two or three should present a significant p value):
anova.cca(step.res3, by="axis")
## No constrained component
## 
## Model: rda(formula = Combined_invasive.hell ~ 1, data = TRY)
##          Df Variance  F Pr(>F)
## Model     0  0.00000  0       
## Residual 17  0.71184
(R2adj2 <- RsquareAdj(step.res3)$adj.r.squared)
## numeric(0)