Ggplot troubleshoot: Error: Aesthetics must be either length 1 or the same as the data (24): x, y, fill

The sample you provided now only contains "SUNDRY" after the summarize step. It may be better for you to subset your data using filter so you can better control what the output will contain rather than just simply subsetting by index. Also, if you use the reprex package then you will know whether the data you are providing have all the necessary data included.

Please see here about creating a reprex

1 Like