Hello,
I have a graph coded in this way:
When plotted Q18_10 comes second in order on the graph and I want to put it last. I'm not sure why this happens but any help would be appreciated! Thank you in advance.
final_plot_data %>%
dplyr::select(c(
"Condition", "Q18_1_mean", "Q18_2_mean", "Q18_3_mean", "Q18_4_mean", "Q18_5_mean", "Q18_6_mean", "Q18_7_mean", "Q18_10_mean","Q18_1_sd", "Q18_2_sd", "Q18_3_sd", "Q18_4_sd", "Q18_5_sd", "Q18_6_sd", "Q18_7_sd", "Q18_10_sd"
)) %>%
tidyr::pivot_longer(
cols = -Condition,
names_to = c("variable", ".value"),
names_pattern = "(.*)_(.*)"
) %>%
ggplot(aes(x = variable, y = mean, fill = Condition)) +
geom_col(position = "dodge") +
geom_errorbar(
aes(ymin = mean - sd, ymax = mean + sd),
width = 0.2,
position = position_dodge(.9)
) +
ggplot2::scale_fill_grey() +
labs(x = "Relevance Scale Questions (1-7 & 10)", y = "Mean Relevance Rating") +
theme(text=element_text(family="Times New Roman", size=12)) +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank()) +
theme(panel.background = element_blank())
theme_classic()