Posted on 29th April 2025|350 views
How to resolve the Error: Aesthetics must be either length 1 or the same as the data (2): fill?
I have a code like
> b <- ggplot(data= yield2016_drought7,aes_string(x = "Condition", y = "FT"))
> b+ geom_boxplot(notch = T, fill = c("yellow", "orange", "red", "pink"), outlier.color = NULL) + ggtitle("Flowering Time") + theme(legend.position = "none") + theme_classic()
Error: Aesthetics must be either length 1 or the same as the data (1): fill
Posted on 29th April 2025| views
Try this:
ggplot(data = yield2016_drought7, aes_string(x = "some_Condition", y = "FT")) +
geom_boxplot()