I have created the following tibble working with Bellabeat dataset:
I want to create a point graph adding a trend line using the following function:
Unfortunately the following error message is shown:
geom_smooth() using method = 'loess' and formula 'y ~ x'
Any idea what I am doing wrong?
Many thanks in advance
Make sure that
Calories are the correct column names in your
For better help try to load a reproducible example of data.
Other way is :
# paste the result of dput() dput(daily_activity_summary_all[30 , ]) # for first 30 rows and all columns.
This is information about the smoothing method used, not an error message. From the documentation for
Smoothing method (function) to use, accepts either
NULL or a character vector, e.g.
"loess" or a function, e.g.
method = NULL the smoothing method is chosen based on the size of the largest group (across all panels).
stats::loess() is used for less than 1,000 observations; otherwise
mgcv::gam() is used with
formula = y ~ s(x, bs = "cs") with
method = "REML".
Also, I would not get rid of variables just before calculating the totals of those variables.
daily_activity_summary_all <- daily_activity %>% mutate(ActiveDistance = VeryActiveDistance + ModeratelyActiveDistance + LightActiveDistance, ActiveMinutes = VeryActiveMinutes + FairlyActiveMinutes + LightlyActiveMinutes ) %>% select(-c(TrackerDistance, VeryActiveDistance, ModeratelyActiveDistance, LightActiveDistance, VeryActiveMinutes, FairlyActiveMinutes, LightlyActiveMinutes, LoggedActivitiesDistance ) %>% group_by(Id)
This topic was automatically closed 42 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.