Hello,
I am using the following code to create the plot displayed in the attached image.
p <- ggplot(taxa.data, aes(y=R, x=reorder(Genus, R, fun=mean),fill=Morphotype)) + geom_boxplot()+coord_cartesian(ylim =c(1,6.5)) + theme_gray() + scale_y_continuous(breaks = c(1,2,3,4,5,6))+ylab("CCRI")
p +guides(fill=guide_legend(nrow=8))+ theme(axis.title.x = element_blank(), legend.position = "none",panel.grid.major.x = element_blank(),panel.grid.minor.x = element_blank()) +facet_grid(~Type+Morphotype, space="free", scales="free")
Q1. The data is sorted by type and morphotype - both of which are displayed in the strip title. I would like to create new labels for the strip that only include the variables from Morphotype and not the type. Is there a way to suppress the Type labels?
Q2. There are only two Types within the data. Is there a way to create two overarching headings above the strip that summarise this sort (as opposed to at the moment where the type is specified in every facet-grid box).
Q3. Is there a way to sort the order of the facet boxes by the mean of the morphotype they are sorted into?
Thanks