Re: [R] question about error message: "Aesthetics must be either length 1 or the same as the data (226): y and colour"

2021-12-30 Thread Kai Yang via R-help
Thank you all of your help. I'm new in R. I'll follow Bert's and your suggestions to post the question in another area in future.  Happy New Year Kai On Thursday, December 30, 2021, 02:05:12 PM PST, CALUM POLWART wrote: You will get shot down in flames for posting this here. This list

Re: [R] question about error message: "Aesthetics must be either length 1 or the same as the data (226): y and colour"

2021-12-30 Thread Rui Barradas
Hello, This seems like a repetition of a question you already asked and it has nothing to do with the fill aesthetic. The error message is caused by the maps y = mpg[[y]] color = mpg[[c]] First you filter the data keeping only a subset of the rows but now you are using the full data. This

Re: [R] question about error message: "Aesthetics must be either length 1 or the same as the data (226): y and colour"

2021-12-30 Thread Bert Gunter
1. Please read and follow the Posting Guide linked below. Among other things, it says: "For questions about functions in standard packages distributed with R (see the FAQ Add-on packages in R), ask questions on R-help." [The link is:

[R] question about error message: "Aesthetics must be either length 1 or the same as the data (226): y and colour"

2021-12-30 Thread Kai Yang via R-help
Hi R team, I can create a plot using the code below: library(ggplot2) library(dplyr) mpg %>%   filter(hwy <35) %>%    ggplot(aes(x = displ, y = hwy, color = cyl)) +    geom_point() ggsave("c:/temp/hwy_cyl.jpg",width = 9, height = 6, dpi = 1200, units = "in") I want to do the exactly same work