Linking to GEOS 3.11.2, GDAL 3.6.2, PROJ 9.2.0; sf_use_s2() is TRUE
library(raster)
Loading required package: sp
The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
which was just loaded, will retire in October 2023.
Please refer to R-spatial evolution reports for details, especially
https://r-spatial.org/r/2023/05/15/evolution4.html.
It may be desirable to make the sf package available;
package maintainers should consider adding sf to Suggests:.
The sp package is now running under evolution status 2
(status 2 uses the sf package in place of rgdal)
library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:raster':
intersect, select, union
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
library(tidyr)
Attaching package: 'tidyr'
The following object is masked from 'package:raster':
extract
library(ggplot2)
Warning: package 'ggplot2' was built under R version 4.3.3
ants_contrasts$bin[is.na(ants_contrasts$bin)] <-"con"ants_contrasts <-filter(ants_contrasts, bin !="bin")ants_contrasts <-filter(ants_contrasts, type =="EFN"| type =="EFN-only"| type =="EFN_only")ants_contrasts <-mutate(ants_contrasts, treat =ifelse(bin =="only", "EFN-only", type))ants_contrasts <-select(ants_contrasts, -bin, - type)ants_contrasts <-rename(ants_contrasts, type = treat)dfcomp <-rbind(ants, ants_contrasts)dfcomp <-filter(dfcomp, species !="CAMPSAY"& species !="FP")
Compare model performance
library(glmmTMB)library(ggplot2)library(performance)dfcomp2 <-filter(dfcomp, type !="EFN-only")m1 <-glmmTMB(test_auc ~ type + (1|species), data = dfcomp)model_performance(m1)
Phylogenetic tree with 276 tips and 275 internal nodes.
Tip labels:
Eutetramorium_sp._CSM, Proatta_butteli_CSM, Lophomyrmex_striatulus_CSM, Mayriella_transfuga_CSM, Mayriella_ebbei, Dilobocondyla_sp._CSM, ...
Rooted; includes branch lengths.
Phylogenetic tree with 14 tips and 10 internal nodes.
Tip labels:
Crematogaster_navajoa_CSM, Pheidole_hyatti, Solenopsis_xyloni, Myrmecocystus_mimicus, Myrmecocystus_testaceus, Myrmecocystus_flaviceps, ...
Rooted; includes branch lengths.
The following object is masked from 'package:tidyr':
extract
The following object is masked from 'package:raster':
extract
This is ENMeval version 2.0.4.
For worked examples, please consult the vignette: <https://jamiemkass.github.io/ENMeval/articles/ENMeval-2.0-vignette.html>.
Paired t-test
data: ap_present$overlap and ap_245$overlap
t = 6.2477, df = 153, p-value = 3.935e-09
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
0.01758567 0.03385025
sample estimates:
mean difference
0.02571796
Paired t-test
data: ap_present$overlap and ap_370$overlap
t = 6.7092, df = 153, p-value = 3.575e-10
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
0.02102931 0.03858260
sample estimates:
mean difference
0.02980595
check <-filter(efn_breath, name !="PFREM")t.test(ants_breath$b2, efn_breath$b2)
Welch Two Sample t-test
data: ants_breath$b2 and efn_breath$b2
t = 1.3749, df = 20.117, p-value = 0.1843
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.05731581 0.27922217
sample estimates:
mean of x mean of y
0.6314036 0.5204504
t.test(ants_breath$b2, check$b2)
Welch Two Sample t-test
data: ants_breath$b2 and check$b2
t = 0.92635, df = 21.817, p-value = 0.3644
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.07708354 0.20142695
sample estimates:
mean of x mean of y
0.6314036 0.5692319
Warning in match.phylo.data(phy, x): Data set lacks taxa names, these are
required to match phylogeny and data. Data are returned unsorted. Assuming that
data and phy$tip.label are in the same order!
Warning in match.phylo.data(phy, x): Data set lacks taxa names, these are
required to match phylogeny and data. Data are returned unsorted. Assuming that
data and phy$tip.label are in the same order!
Warning in match.phylo.data(phy, x): Data set lacks taxa names, these are
required to match phylogeny and data. Data are returned unsorted. Assuming that
data and phy$tip.label are in the same order!
vi$end <-replace_na(vi$end,"clim")vi <-filter(vi, end =="clim")#remove the two excluded ant species (due to poor AUC performance)vi <-filter(vi, species !="fp.csv"& species !="campsay.csv")ggplot(vi, aes(Variable, Permutation_importance)) +geom_boxplot()
pc1 <-filter(bothvi, Variable =="PC1")t.test(Permutation_importance ~ type, data = pc1)
Welch Two Sample t-test
data: Permutation_importance by type
t = 2.3156, df = 16.276, p-value = 0.03394
alternative hypothesis: true difference in means between group ant and group EFN is not equal to 0
95 percent confidence interval:
1.637086 36.540057
sample estimates:
mean in group ant mean in group EFN
33.12857 14.04000
pc2 <-filter(bothvi, Variable =="PC2")t.test(Permutation_importance ~ type, data = pc2)
Welch Two Sample t-test
data: Permutation_importance by type
t = -2.6649, df = 14.193, p-value = 0.01831
alternative hypothesis: true difference in means between group ant and group EFN is not equal to 0
95 percent confidence interval:
-36.794846 -4.002296
sample estimates:
mean in group ant mean in group EFN
23.17143 43.57000
pc3 <-filter(bothvi, Variable =="PC3")t.test(Permutation_importance ~ type, data = pc3)
Welch Two Sample t-test
data: Permutation_importance by type
t = -0.39714, df = 20.85, p-value = 0.6953
alternative hypothesis: true difference in means between group ant and group EFN is not equal to 0
95 percent confidence interval:
-15.70397 10.66968
sample estimates:
mean in group ant mean in group EFN
20.84286 23.36000
pc4 <-filter(bothvi, Variable =="PC4")t.test(Permutation_importance ~ type, data = pc4)
Welch Two Sample t-test
data: Permutation_importance by type
t = 0.97102, df = 18.416, p-value = 0.3441
alternative hypothesis: true difference in means between group ant and group EFN is not equal to 0
95 percent confidence interval:
-4.38028 11.93171
sample estimates:
mean in group ant mean in group EFN
22.83571 19.06000