This package imports data from Apple Health. It is usuable for basic analyses at the moment, but still in an early state. Expect that the user inferface is still subject to potentially major changes.
At the moment healthieR
is not on CRAN, but can be installed from my drat repository:
install.packages("drat")
drat::addRepo("paulstaab")
install.packages("healthieR")
To import the data, enter the Path the the Export.zip archive here
zip_file <- "./Export.zip"
and load use the read_apple_health
function to convert it into an format that we can query from R
later:
library(healthieR)
health_data <- read_apple_health(zip_file)
health_data
#> Apple Health Export from 2017-01-25 19:11:49
#> Containing:
#> * 71 health records
You can new use the extract functions to optain different parts of your data as a data.frame
;
suppressPackageStartupMessages(library(dplyr))
health_data %>% extract_steps()
#> type start_time end_time unit value
#> 1 StepCount 2016-06-06 10:55:57 2016-06-06 10:56:12 count 22
#> 2 StepCount 2016-06-06 11:04:03 2016-06-06 11:09:55 count 78
health_data %>% extract_weight()
#> type start_time end_time unit value
#> 1 BodyMass 2016-06-10 05:30:00 2016-06-10 05:30:00 kg 88.8
#> 2 BodyMass 2016-06-12 20:07:00 2016-06-12 20:07:00 kg 99.9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.