Skip to content

Instantly share code, notes, and snippets.

@akshat3096
Last active May 3, 2019 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshat3096/cec4a26f8ea308fbb0f61eeaee8a387d to your computer and use it in GitHub Desktop.
Save akshat3096/cec4a26f8ea308fbb0f61eeaee8a387d to your computer and use it in GitHub Desktop.
energy <- df %>%
filter(type == 'HKQuantityTypeIdentifierActiveEnergyBurned') %>%
group_by(date,year,month) %>%
summarize(energy_burned=sum(value))
energy$date <- as.Date(energy$date,"%Y-%m-%d")
plot3 <- ggplot(energy,aes(x=date, y=energy_burned, group=year)) +
geom_line(aes(colour=year))+
ggtitle("Total Energy burned")
plot3+
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