I am trying to get a combination of colours I want and legend labels I want with ggplot2 graph.
Essentially the code below achieves most things apart from I can't get the legend label to display what I want, ideally I would like it to be 'treatment 1' with '1' as subscript but I can't put an expression like this expression('treatment'[+1]) as it doesn't seem to accept it in the labels argument. Can someone help please it's driving me crazy!
I think it should be possible to insert it somewhere else in the syntax but I am unsure as to where.
graph1<-ggplot(data2, aes(SMR_residuals,y=log(Time), color = factor(Treatment, labels = c("1", "2", "3","4")))) + geom_point() + labs(color = "Treatment") +
geom_smooth(method="lm", se=F) + scale_colour_brewer(palette = "Set1")