Re: [R] AES spesification

2020-10-21 Thread Rui Barradas
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 ==

Re: [R] AES spesification

2020-10-21 Thread Dr. Robin Haunschild
Hi, what about this one? ggplot(data=mpg[mpg$year==1999,], aes(x=displ, y=hwy))+ geom_point() Best, Robin On 10/21/20 3:37 PM, Engin Yılmaz wrote: > Dear > > I use dataset , as called "mpg" > > This is code > > ggplot(data=mpg)+ geom_point(mapping = aes(x=displ, y=hwy, colour=year)) > > Bu

[R] AES spesification

2020-10-21 Thread Engin Yılmaz
Dear I use dataset , as called "mpg" This is code ggplot(data=mpg)+ geom_point(mapping = aes(x=displ, y=hwy, colour=year)) But I would like to see only "year of 1999" in this relationship between x and y variables How could I change the code in this direction? I found the following code libr