A bunch of googling and stack exchange took me to the many discussions of using R for meteorological variables. That's familiar territory. It's also what is needed to transform the raw Fitbit 5-minute data into hourly and daily data. After all that reading the magic command is:
daily <- aggregate( df["steps"], list( cut( df$Date, "1 day")), sum)
Now, having looked at various plots and statistical summaries of the result I'm confident that I've got the right data, and I'm not sure what to do with it. This means I let it sit for a while and think about it.
My first reaction was that this looked like a very inefficient solution to the problem. It might be. But it only took about a second to process 213K 5-minute entries into 740 daily entries.
Comments