FitAnalyzer: R6 class for Analyzing Fitbit Data

Description Usage Format Methods


FitAnalyzer is an R6 class for analyzing Fitbit data. It is an opinionated implementation of a particular workflow for analysis. For people attempting to conduct their own analysis in a different fashion you should use the more generic functions implemented in FitUtil.

The workflow implemented for FitAnalyzer is the following:
1. Create the FitAnalyzer with the goal variable for analysis. Eg: Calories or steps or distance. The goal variable is your personal goal that you are trying to analyze better.
2. Call findImportantVariables to understand the most important variables unique to you that enable meeting your goal.
3. Call showMostImportantCharts to get relevant charts that are unique to your data
4. Call predictGoal to get a prediction on performance of the goal

You can conduct two types of analysis based on the type of dataset in consideration. analysis.type can be '' or 'daily' analysis.




A R6Class generator object


getAnalysisFrame(folder, analysis.type)

This method uses analysis.type as an argument to return a data.frame that is clean and augmented with additional features like weekend.

findImportantVariables(tsDataFrame, seed = 12345)

Finds the most important variables that are enabling meeting the goals for the person, by creating a 'glm' model and ranking the variables based on the coefficients of the model.


Returns the 'glm' fit object.


Plots charts for the most relevant goals, with actual data and moving average using geom_smooth().
tsDataFrame: a data.frame containing the fitibit activities.


Gives a prediction on the goal performance, based on 'glm' (daily) or 'gbm' (intraday).

fitcoach documentation built on April 14, 2017, 7:52 a.m.