I have a data frame with measurements in different conditions. I set the conditions as a factor using a notation for ease of use. I now want to plot the data and assign meaningful labels to the factors. I am using ggplot2; for the x axis I would like to keep the factors but in the legend I would like to use custom values. I tried different combinations but none worked. What is the correct way to assign custom labels to legends in ggplot2? Thank you
EXAMPLE: ``` df = data.frame(Target = 1:4, Rate = c(0.02078663, 0.03685543, 0.02238002, 0.05033979), SD = c(0.003043398, 0.001447410, 0.002998729, 0.002171813)) df$Target = factor(df$Target) ggplot(df, aes(x=Target, y=Rate, colour=Target, group=Target)) + geom_point(size=8) + geom_errorbar(aes(ymin=Rate-SD, ymax=Rate+SD), width=.1) + scale_colour_manual(values = COLS) + xlab(expression(bold("Class"))) + ylab(expression(bold("Value"))) + theme_classic(base_size = 15) ``` NOTE: if using ``` ... theme_classic(base_size = 15, labels = c("Condition 1", "Condition 2", "Condition 3", "Control")) ``` I get the error: Error in theme_classic(base_size = 15, labels = c("Condition 1", "Condition 2", : unused argument (labels = c("Condition 1", "Condition 2", "Condition 3", "Control")) ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.