Skip to content

Instantly share code, notes, and snippets.

View loopingleo's full-sized avatar
🍍
✋🏼

Leo loopingleo

🍍
✋🏼
  • Munich
View GitHub Profile
@loopingleo
loopingleo / apple_health_load_analysis_R.r
Created July 10, 2018 08:58 — forked from ryanpraski/apple_health_load_analysis_R.r
Load Apple Health Kit export.xml file in R then analyze and visualize Steps Data using R. See the full post here: http://www.ryanpraski.com/apple-health-data-how-to-export-analyze-visualize-guide/
library(dplyr)
library(ggplot2)
library(lubridate)
library(XML)
#load apple health export.xml file
xml <- xmlParse("C:\\Users\\praskry\\Desktop\\apple_health_data\\export.xml")
#transform xml file to data frame - select the Record rows from the xml file
df <- XML:::xmlAttrsToDataFrame(xml["//Record"])