I was curious however, if it is possible to add any specific legend or put which species corresponds in the observed-expected plot, to know which circle it is respectively. I am using a fake dataset at the moment called finches. The package is called "cooccur" which creates a ggplot object. I was curious on how to actually edit this to put labels of species on here.
Alternatively is to extract the labels and co-occurrences and use base graphics, but this is not as ideal.
CODE SNIPPET BELOW
library(devtools)
#install_github("griffithdan/cooccur")
library(cooccur)
options(stringsAsFactors = FALSE)
data(finches)
cooccur.finches <- cooccur(mat=finches,
type="spp_site",
thresh=TRUE,
spp_names=TRUE)
summary(cooccur.finches)
plot(cooccur.finches)
p <- obs.v.exp(cooccur.finches)
# the ggplot2 object can be edited directly and then replotted
p
# alternatively, use base graphics, This is what I am currently doing but it is not correct
cooc.exp <- cooccur.finches$results$exp_cooccur
cooc.obs <- cooccur.finches$results$obs_cooccur
sp1 <- cooccur.finches$results$sp1_name
sp2 <- cooccur.finches$results$sp2_name
plot(cooc.obs ~ cooc.exp)
text(x = cooc.exp[1], y = cooc.obs[1], labels = sp1[1]) # plots only one name