I'm having issues getting my plot in R to display the days of week. Whenever I attempt to plot the data, it just comes up as one big blob but it doesn't differentiate in the days of the week. I believe its caused by the ordered data type it is in however it doesn't have an order to the data. How would I go about putting the data in an order so I can display any days of the week?
- what the graph looks like for me.
The code I'm using for the graph
ggplot(data = daily_activity_cleaned) + aes(x = day_of_week, y = total_steps) +
geom_col(fill = 'blue') +
labs(x = 'Day of week', y = 'Total Steps', title = 'Total steps taken in a week')
What data type it is
str(daily_activity_cleaned$day_of_week)
Ord.factor w/ 7 levels "Sun"<"Mon"<"Tue"<..: NA NA NA NA NA NA NA NA NA NA ...
One of many options that I have tried to fix this problem.
daily_activity_cleaned$day_of_week <- wday(x, week_start ="lubridate.week.start", 7)
Thanks for all the help again and please let me know if I need to include anything else