Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Nelson benjaminwnelson

View GitHub Profile
@ryanpraski
ryanpraski / apple_health_load_analysis_R.r
Last active Jun 21, 2021
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/
View apple_health_load_analysis_R.r
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"])
anonymous
anonymous / helath_analysis
Created Mar 30, 2015
Analyze your Health app data using R
View helath_analysis
# -*- coding: utf-8 -*-
# Setting up all required elements
setwd('~/Documents/Health')
options(stringsAsFactors=FALSE)
Sys.setlocale(category="LC_ALL", locale = "en_US.UTF-8")
library(XML)
library(ggplot2)
#####################