R code for calculating fitness metrics from ambulatory data