Created
February 22, 2017 18:33
-
-
Save carlislerainey/0111324011a7a86d8b2584c16694c826 to your computer and use it in GitHub Desktop.
Code to load my run logs from Google Sheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data loading and tidying | |
########################## | |
# Note: we haven't talked about how to do this, and I don't expect you to | |
# understand the code below. | |
library(dplyr) # useful function for cleaning up data | |
library(lubridate) # useful for working with dates and durations | |
library(magrittr) # useful for data manipulation | |
library(googlesheets) # used to load the google sheet data | |
sheet <- gs_key("19aZA5_xnMiNfrpJpVur1FxNWGxUe3l-LlJ8vPp7_uBc") # register google sheet | |
runs <- gs_read(sheet) # load sheet | |
runs <- runs %>% | |
mutate(date = mdy(date), | |
minutes = as.numeric(time)/60) %>% | |
rename(average_heart_rate = av_hr) %>% | |
select(-time) | |
# done with tidying | |
################### | |
# quick look at data | |
tibble::glimpse(runs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment