Why am getting `check_aesthetics()' error while using ggplot() function?

Below is my code

ggplot(daily_activity_sleep, aes(x=steptotal , y=calories))+
geom_jitter() +
geom_smooth(color = "red") +
labs(title = "Daily steps vs Calories", x = "StepTotal", y= "calories") +
theme(panel.background = element_blank(),
plot.title = element_text( size=14))

I am getting error which is

Error in check_aesthetics():
! Aesthetics must be either length 1 or the same as the data (9699): y

The error message is referencing your specific data frame and since you are not providing sample data it would be hard for us to know why you get that error.

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.