I do not know how to achieve your Q2.
For Q3, do you mean like this?
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 3.5.3
library(tidyr)
#> Warning: package 'tidyr' was built under R version 3.5.3
library(dplyr)
#> Warning: package 'dplyr' was built under R version 3.5.3
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
df <- data.frame(
R = c(2.25, 1.96, 1.51, 1.78, 2.12, 2.24, 2.31, 2.61, 2.08, 2.62,
2.5, 3.1, 2.74, 2.64, 2.62, 2.65, 3.1),
Genus = as.factor(c("Ab", "Ab", "Ac", "Ac", "At1", "At1", "En", "En",
"Mo", "Mo", "St", "St", "St", "s1", "s1", "s2",
"s2")),
Morphotype = as.factor(c("Acropora", "Acropora", "Acropora", "Acropora",
"Acropora", "Acropora", "Branching", "Branching",
"Branching", "Branching", "Branching", "Branching",
"Branching", "Sand", "Sand", "Sand", "Sand")),
Type = as.factor(c("biotic", "biotic", "biotic", "biotic", "biotic",
"biotic", "biotic", "biotic", "biotic", "biotic",
"biotic", "biotic", "biotic", "abiotic", "abiotic",
"abiotic", "abiotic"))
)
df <- df %>% unite(col = BothLabels, Type, Morphotype, sep = "_", remove = FALSE)
df <- df %>% mutate(BothLabels = reorder(BothLabels, R, mean))
RmType <- function(string) {
sub(".+_", "", string)
}
ggplot(df, aes(y=R, x=reorder(Genus, R, fun=mean),fill=Morphotype)) + geom_boxplot() +
facet_wrap(~BothLabels, labeller = labeller(BothLabels = RmType), scales = "free_x") +
labs(x = "Genus")

Created on 2019-10-28 by the reprex package (v0.3.0.9000)