-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.R
More file actions
38 lines (30 loc) · 1.02 KB
/
Copy pathtest.R
File metadata and controls
38 lines (30 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# read in associated species data
sppDat <- read.table("AssociatedSppData_Serp.csv",header=TRUE,sep=",",stringsAsFactors = FALSE)
head(sppDat)
# reshape data using dcast function in reshape2 package
library(reshape2)
PA <- dcast(sppDat,formula=SpeciesName~SitePatch)
head(PA)
library(EcoSimR)
library(MASS)
# Run null model with SIM9 algorithm & CHECKER index
adMod1 <- cooc_null_model(PA,algo= "sim9",metric="checker",nReps=1000,suppressProg=T)
# Summary and plots
summary(adMod1)
mean(adMod1$Sim)
plot(adMod1,type="hist")
plot(adMod1,type="cooc")
plot(adMod1,type="burn_in")
## Run null model with SIM9 algorithm and C score index
adMod2 <- cooc_null_model(PA,algo= "sim9",metric="c_score",nReps=1000)
# Summary and plots
summary(adMod2)
plot(adMod2,type="hist")
plot(adMod2,type="cooc")
plot(adMod2,type="burn_in")
# Run null model with SIM9 algorithm and COMBO index
adMod3 <- cooc_null_model(PA,algo= "sim9",metric="species_combo",nReps=1000)
# Summary and plots
summary(adMod3)
plot(adMod3,type="hist")
plot(adMod3,type="cooc")