Co-Occurr Package (ggplot2 adjustments)
1
0
Entering edit mode
4.1 years ago

Ive' 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 and y labels.

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 second 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)

#CoOccurrence Plot species_cooccurrence_plot <- plot(cooccur.finches)+ ggtitle("Species Co-Occurrence Matrix") +   theme(text = element_text(size=5))
#View Co-Occurrence Plot species_cooccurrence_plot

#Creation of Species Association Profile species_association_profile <- pair.profile(cooccur.finches) + ggtitle("Species Associtation Profile") +
    theme(text = element_text(size=5),
          axis.text.x = element_text(angle=90, hjust=1))

#View Association Profile 
species_association_profile
ggplot R r cooccur • 1.4k views
ADD COMMENT
2
Entering edit mode
4.1 years ago
ATpoint 82k

If you want to change axis text size then it has to be part of the element_text that controls the axis:

element_text(angle=90, hjust=1, size=5)

ADD COMMENT

Login before adding your answer.

Traffic: 1296 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6