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
Backtrace:
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 repr oducible ex ample (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
system
Closed
June 25, 2022, 1:46am
3
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.