Skip to content

Instantly share code, notes, and snippets.

@akshat3096 akshat3096/step_count.R
Last active May 3, 2019

Embed
What would you like to do?
steps <- df %>%
filter(type == 'HKQuantityTypeIdentifierStepCount') %>%
group_by(date,year,month) %>%
summarize(steps=sum(value))
steps$date <- as.Date(steps$date,"%Y-%m-%d")
plot2 <- ggplot(steps,aes(x=date, y=steps, group=year)) +
geom_line(aes(colour=year))+
geom_snooth(se=F)+
ggtitle("Total Steps Everyday")+
xlab("Month/Year")
plot2+
scale_x_date(date_labels = "%b/%Y")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.