Melding TCX & CSV files for iFit workouts
Note that you only need the one file (iFit.R). The other files are just convenient for me to associate them here.
Installation
-
Download R from https://cran.r-project.org/
-
Run the installer
-
Open the RGui program
-
In the RGui program go to the Packages menu A. Click Install Packages... B. Choose the location nearest to you C. Install the following packages...
- data.table
- zoo
- XML
- lubridate
- stringr
Note: you may need to install 1 at a time.
-
Now open the iFit.R file in the RGui
-
Copy the entire contents of the iFit.R file
-
Click the "Window" button at the top to return to the console
-
Paste the text that you copied
Creating the better TCX file
-
In iFit download both the TCX and CSV with Elevation files and put them into the same directory.
-
Run the command to create the better TCX file
a <- meld_iFit_S22i_CSV_TCX_to_better_TCX(chr.file = 'filename without extension', chr.path = 'directory files are in')
ex. a <- meld_iFit_S22i_CSV_TCX_to_better_TCX(chr.file = '2021_03_05_19_03_Playa_Guiones_Interval_Walk,_Costa_Rica', chr.path = 'C:\iFit\')
Note: If the filename contains "Ride" then the Activity will be set to "Biking" in the tcx file, otherwise it defaults to "Running"
-
Upload the file that ends in better to Garmin/Strava