A small R library to generate a report of data collated from exercising using a Reebok ZR8 exercise bike
If you are running Ubuntu, you'll need to install libxml2-dev
sudo apt-get install libxml2-dev
Then you can install this library from github using devtools
:
# install.packages("devtools")
devtools::install_github("hiraethus/workout.tracker")
Currently, workout.tracker takes an valid document containing descriptions of workouts validated against workout_data.xsd
which is found in the inst/
directory of this project.
A typical workout xml document will be formed as follows:
<?xml version="1.0" encoding="UTF-8"?>
<workout-tracker>
<configuration>
<heightCm>160.1</heightCm> <!-- takes positive decimal value -->
</configuration>
<workouts>
<workout>
<date>2013-12-30</date> <!-- takes a date in _big endian_ format -->
<level>1</level> <!-- takes positive integer value -->
<timeInMinutes>20</timeInMinutes> <!-- takes positive integer value -->
<caloriesBurned>340</caloriesBurned> <!-- takes positive integer value -->
<distanceCoveredKm>9.62</distanceCoveredKm> <!-- takes positive decimal value -->
<recoveryScore>F4</recoveryScore> <!-- takes the values F1 through F6 -->
<waistSizeCm>110.1</waistSizeCm> <!-- optional - takes positive decimal value -->
<weightKg>80</weightKg> <!-- optional - takes positive decimal value -->
</workout>
</workouts>
</workout-tracker>
Once this xml document has been loaded, the data can be loaded in to R using:
workout.tracker::generate.report(path.to.workout.xml = "<path-to-xml-document>")
The result contains a list containing a data.frame
with all of the workout data as well as a second data.frame
which shows the number of workouts per week for each week since the first workout in the xml document.
Also under development is a dashboard to give prerendered visualisations of data to the user for daily analysis. To run the shiny app:
workout.tracker::run.server()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.