+ All Categories
Home > Data & Analytics > Hacking health data

Hacking health data

Date post: 12-Jan-2017
Category:
Upload: cjlortie
View: 152 times
Download: 0 times
Share this document with a friend
20
hacking health data @cjlortie
Transcript

hacking health data

@cjlortie

do or do not,

there is no try.

(almost) everything we do generates a digital signal and data

data are like the force

many tools

watches, smartphones, fitbits, sensors, shoes, & clothes

you own your data

challenge #1. secure individualhealth data

R helps

fitbitscrapertrackeRrStrava

httr

fitbitscaper for specific functions

#login using Rcookie = login("email", "password", rememberMe = TRUE)

#scrape key datadaily.steps <-get_daily_data(cookie, what="steps", start_date="2011-01-01", end_date=“2016-10-10")

daily.sleep <- get_sleep_data(cookie, start_date="2016-01-01", end_date="2016-10-10")

longitudinal data in different datasets

relationships & relational

challenge #2. date formats

time in many formats: fascinating & can capture change

lubridatetidyverse

hms

http://r4ds.had.co.nz/dates-and-times.html

time challenges R can resolve

<date> formats vary from %Y-%m-%d

<time> units in health & sport sciences

<dttm> date plus time in a single vector

<date> or <dttm> in separate strings

ymd("2017-01-31")

as.integer(10K$time) or period_to_seconds(hms(10K$time))

as.Date("2011-01-31 23:59:59", format = “%Y-%m-%d")

make_datetime(year, month, day, time %/% 100, time %% 100)

finish line fixes

challenge #3. joining datasets

connect the relevant dots

# list the filesfiles <- list.files(path = "data/",pattern = ".csv", full.names = T)# Read the filesl <- lapply(files, read_csv)# combine the dataframesd <- bind_rows(l, .id="year")

dplyr, readr, stringr

full_join(sleep, running, by = "year")

big data lessons for little data

capture the DNA of your personal health & training

but find key markers to decode message

https://cjlortie.github.io/quantified.me/

actionable data


Recommended