`Preformatted text
install.packages("gridExtra")
install.packages("grid")
install.packages("extrafont")
install.packages("showtext", dependencies = TRUE)
install.packages("RColorBrewer")
install.packages("scales")
#packages for graphs
library(ggplot2)
library(tidyverse)
library(grid)
library(gridExtra)
library(showtext)
library(extrafont)
library(RColorBrewer)
library(scales)
#######################
#Treatment x Male vs Female Graphs
#######################
a1 <- read.csv('Data.csv')
Treatment.Sex = ddply(a1,~Treatment*Sex,summarize,meanQ1=100*mean(Q1,na.rm=T)+
Treatment.Sex$Treatment = factor(Treatment.Sex$Treatment,levels=c("CONTROL","A","B","C","D","E"))+
###Plot for Question Q1
ggplot(data=Treatment.Sex,aes(x=Treatment,y=meanQ1,fill=Sex))+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"))+
geom_bar(stat="identity",position=position_dodge(),colour="black")+
geom_smooth(method='lm',color="BLACK")+
scale_fill_manual(values=c("coral","cornflowerblue"))+
xlab("Treatments")+
ylab("Proportion of Correct Responses (%)")+
theme(legend.title=element_blank())+
ggtitle("Q1: Correct Responses by Sex")+
theme(text=element_text(size=16))```
##############
Hi there! Can anyone help with my buggy code to generate ggplot2
I'm looking to create two versions of these plots:
1) One graph - showing male and female sexes' responses to Question 1 on the one graph
2) A second example with two graphs- male and female sexes' responses to Question 1 on separate graphs.
[Data for GGPLOT2](https://drive.google.com/drive/folders/1bGFKI89dU1NpKIVM2HaXAmRznLHGz0yE?usp=sharing)
###################
-->