I'm new to ggplot2 so please bear with me. I would like to make a scatter plot in ggplot2 where I can color the data OR change the size of the points based on a second variable factor. I am able to do this for color using the plot() function as so:
#simulate data
x1 <- rnorm(100)
y <- as.factor(runif(100)<=.70)
df <- data.frame(x1,y)
#plot
plot(df$x1, col = df$y,cex = 1, pch = 19)
And this is my attempt with ggplot2:
qplot(seq_along(df$x1), df$x1) + scale_colour_manual(breaks = df$y)

