logo-MindMajix
S
Swetha Shetty

Posted on 16th June 2024|350 views

1
votes

Aesthetics Must Be Either Length 1 Or The Same As The Data

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

 

1 answers
Answers
P
Anusha V

Posted on 16th June 2024| views

Try this:

ggplot(data = yield2016_drought7, aes_string(x = "some_Condition", y = "FT")) + 

  geom_boxplot()

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number