I've been using the R package "cooccur" to measure co-occurrence among bird species, a package that produces its own R objects. I am not very familiar on this and want to make changes to the sizes of its x or y labels. (similar question for another plot asked here: Modify GGplot2 Object)
I'm trying to adjust the size of the font of the plot but using theme(), I've been successful in changing the angle of the plot but have not had any success with adjusting font size for both. This only changes the position of the graph for some reason.
Note: These graphs are created as ggplot2 objects from the specific package I am using for this analysis.
(I'm not sure if this belongs to this community specifically though, I'm just curious also if others have used this package).
help please :/
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]) # plot one name
#CoOccurrence Plot
p <- plot(cooccur.finches)
p + ggtitle("GCF Co-Occurrence Matrix")#+
theme(axis.text.y = element_text(size = 20), axis.text.x = element_text(size = 50))