Skip to content
Prev 386041 / 398513 Next

AES spesification

Hello,

You can subset the data argument.
And if you are plotting one year only, there's no point in color = year.

ggplot(subset(mpg, year == 1999), aes(displ, hwy)) +
   geom_point()


If you are loading package dplyr, you can filter directly to ggplot:


library(dplyr)

mpg %>%
   filter(year == 1999) %>%
   ggplot(aes(displ, hwy)) +
   geom_point()


Hope this helps,

Rui Barradas


?s 14:37 de 21/10/20, Engin Y?lmaz escreveu: