knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

Project Status: WIP - Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Travis-CI Build Status AppVeyor Build Status Coverage Status CRAN_Status_Badge

healthieR

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.

Installation

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")

Obtain the Data

  1. Open the Apple Health App on your iPhone / iPad
  2. Go to the "Data" tab
  3. Click the little portait in the upper right corner
  4. Scroll down to "Export Data"
  5. Use Dropbox, Email or something similar to transfer the Export.zip to your computer

Load the Data

To import the data, enter the Path the the Export.zip archive here

zip_file <- "./Export.zip"
zip_file <- system.file("example_data/Export.zip", package = "healthieR")

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

Analyse the Data

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()
health_data %>% extract_weight()


paulstaab/healthieR documentation built on May 24, 2019, 10:33 p.m.