library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(size=4)
Suppose you have the above scatterplot. How can you speci
Sure it can, although this type of work if probably best suited to working with your data frame before ggplot(). You could use ifelse() like this:
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point(size = 4,
aes(color = ifelse(mpg > 25, "> 25",
ifelse(mpg > 20, "20-25", "< 20")))) +
scale_color_manual(values = c("> 25" = "red", "< 20" = "blue", "20-25" = "green"),
name = "MPG" )

You don't need to call guides() to create a title you can pass it to the name = .. argument in scale_color_manual()