Data discovery: seasonal speed

Just writing this one quickly as it’s been hanging around my browser tabs for weeks… I wrote Taking steps (in XML) almost 7 years ago and once in a while, I still grab Apple Health data from my
Data discovery: seasonal speed

Just writing this one quickly as it’s been hanging around my browser tabs for weeks…

I wrote Taking steps (in XML) (https://nsaunders.wordpress.com/2017/02/01/taking-steps-in-xml/) almost 7 years ago and once in a while, I still grab Apple Health data from my phone and play around with it in R for a few minutes. Sometimes, curve fitting to a cloud of points generates a surprise.

library(tidyverse) library(xml2) theme_set(theme_bw())

health_data <- read_xml(“~/Documents/apple_health_export/export.xml“)

ws <- xml_find_all(health_data, “.//Record[@type=‘HKQuantityTypeIdentifierWalkingSpeed’]”) %>% map(xml_attrs) %>% map_df(as.list)

ws %>% mutate(Date = ymd_hms(creationDate), value = as.numeric(value)) %>% ggplot(aes(Date, value)) + geom_point(size = 1, alpha = 0.2, color = “grey70”, fill = “grey70”) + geom_smooth() + labs(y = “Walking speed (km/h)”, title = “Walking speed data”, subtitle = “Apple Health 2020 - 2023”)

Result:

Huh. Looks seasonal. Looks faster in the (southern) winter. Has that been reported before? Sure has. (https://www.nature.com/articles/s41598-021-91633-1)

It didn’t impress everyone (https://twitter.com/neilfws/status/1742029787299004488) but I thought it was interesting.

Write a comment
No comments yet.