I can't seem to get a legend to appear on this plot. Forums and web tutorials have not provided a solution. Any help would be appreciated.
I have created a bar plot that overlays frequencies when NA values are included and excluded but I need to provide a legend for the plot.
Full_Freq<-data.frame(NA_INC = c(11.8, 10.1, 11.9, 18.8, 17.8, 1.7, 1.7, 1.8, 3.5, .001),
NA_EXC = c(54.9, 38.6, 27.9, 34.7, 36.1, 2.3, 2.3, 2.8, 8.4, 100.0),
code = c("RI1 - R1,C1,A,G,R", "RI2 - R1,C1,A,E,R", "RC1 - R1,C1,A,E,R",
"RP3 - R2,C2,B1L1,BGLG,BRLR", "RP4 - R1,C1,A,P,O", "RM1 A - R3,C3,M1D1L1,MWDELE,MRDRLR",
"RM1 B - R3,C4,M2D1L1,MWDPLP,MRDRLO","RM2 - R3,C3,M1D1L1,MWDGLG,MRDRLR",
"RM3 - R3,C3,M1D1L1,MWDGLG,MRDRLR","RM4 - R1,C1,A,P,R"))
ggplot(Full_Freq) +
geom_col(aes(x = code, y = NA_EXC), fill = "gray", colour = "black") +
geom_col(aes(x = code, y = NA_INC), fill = "black", colour = "black")+
ylab("Percentage")+
xlab("")+
ggtitle("Tooth and Full Phenotype Code")+
theme_classic()+
theme(plot.title = element_text(hjust= 0.5))+
theme(axis.text.x = element_text(angle = 90, vjust=0.5))