Subscribe Bookmark RSS Feed
shannon_conners

Joined:

Jun 23, 2011

Import BodyMedia(R) FIT Activity and Food Log Data into JMP

Food and Fitness File Import Add-In

 

Version 1.0, October 17, 2014

 

Installing this add-in will add three items to your JMP menu under Add-Ins > Fitness and Food. Two of these items can help you automatically import and combine files exported from BodyMedia®’s Activity Manager software and the third will help import files from the free MyFitnessPal food logging web site. 

Please read the Requirements section for each item in this add-in.  Minimally, you must have access to one or more files exported from one of these web-based tracking tools to use this add-in. If you have access to Excel Activity Summary or text Food Log files exported from the BodyMedia® Activity Manager software or MyFitnessPal, please proceed to install the addin by dragging it into JMP 11 and clicking the Install button in the dialog that pops up.

 

Known issues:

 

  • If your comma separated MFP food log files is saved with a .txt file extension, you will have to change its extension to .csv to import the file using this add-in.
  • If any of your BodyMedia® Activity Summary Excel files lack weight measurements on the Weight worksheet, you may get an error while trying to import.  Each activity file must contain at least one weight measurement.  If you add measurements on the Weight tab to work around this error, be sure to add a Date variable for each measurement in a cell of Text data type.  For some reason, using General type for date variables in Excel for these files can cause import errors where the date variable shows up as blank in the imported file, causing the merge to stop.
  • If any of your food log files contain rows where you recorded a food item quantity as <1 serving, then the serving quantity will be recorded as 0 in your imported data table.  This appears to be an unfortunate artifact of the PDF to text conversion, since decimal-formatted serving information is shown in the original Food Log PDF but becomes 0 when converted to a text file.

    Introduction to BodyMedia® Import Tools in this Add-In

    The BodyMedia® FIT® Activity Manager software is a subscription-based software tool used as a companion to various BodyMedia® FIT® activity monitors.   After receiving data from a BodyMedia® activity monitor via Bluetooth or USB connection, the Activity Manager displays daily dashboards of calories burned and consumed as well as food log data entered by the user. 

    After downloading and installing this Fitness and Food add-in, you will see two items under its BodyMedia submenu.  The first menu item is called Import activity summary files from Excel.  If you click on this item, you will be prompted to choose a directory where you have saved one or more BodyMedia® activity data summary files.  After you select the directory and specify an output folder and file name, your Activity Summary files will be automatically imported into a single JMP table and columns formatted with the appropriate types for further visualization and analysis.

    The second item is named Import food log files from text.  If you click on this item, you will be prompted to choose a directory where you have saved one or more BodyMedia® food log files.  These files are exported from BodyMedia® in PDF format but must be saved as text files before using this add-in to import them.  After you select the directory and specify an output folder and file name, your BodyMedia® food log text files will be automatically imported into a single JMP table and formatted for further visualization and analysis.

    If you have access to Activity Summary files exported from the BodyMedia® Activity Manager software, you can import them using the directions in the next section.

    Import Activity Summary files from Excel

    Requirements:

  

  • To use this item, you must have access to one or more Activity Summary files in Excel format.  These files have a specific structure that the add-in recognizes.
  • All your exported summary files must be saved into a single directory, and you should not save Excel files of any other type in the same directory.  Currently, the add-in will prompt for a directory and import all the Activity Summary files it contains into a single JMP data table.  Excel files of other types should be ignored, but it’s possible that the presence of incomplete exported files or other files with variable names that match those in BodyMedia files could cause problems with output.
  • If you are collecting your own data using a BodyMedia® FIT® armband and have an active subscription to the Activity Manager software, you may export new Activity Summary files at any time by clicking the Export link on the Dashboard page for any day. (See below for more detailed instructions.)
  • Alternatively, you can use this add-in to import one or more files exported from BodyMedia®’s Activity Manager software by you or another software subscriber.

    Before you can import any BodyMedia® Activity Summary files into JMP, you must first export them from BodyMedia®’s web-based Activity Manager software in Excel format. You can do this by clicking on the Export link at the right top of your Dashboard page and selecting date ranges in weekly increments from 7-28 days.

Save Excel Export.png

I recommend exporting files in 28 day increments to minimize the number of files you will need to save. By default, exported data files are saved with the current day's date in the title.  When I export my own files, I always save them with a new name that includes the date range of the data in the file.  This helps minimize the chance of accidentally overwriting files when I am exporting data for multiple months on the same day.

After you have exported your BodyMedia® files, click Add-Ins > Fitness and Food > BodyMedia® > Import activity summary files from Excel to import your files into JMP.  A directory chooser window will launch asking you to specify the directory where your activity summary files are saved.  All files must be saved in a single directory. Please make sure that the directory doesn't contain any other types of Excel files with non-BodyMedia® data.  This add-in doesn't currently check Excel files to verify that only files exported from BodyMedia® are present, so if you have unrelated Excel files in the specified directory, you may get unexpected results.

Structure of Imported and Combined Activity Data Table

Below is a list of columns that should be imported from your BodyMedia® Activity Summary files along with additional columns that will be added to the combined data table during the import process.  The names of new columns are shown below in bold.

Column

Column Group

Column Name

JMP format

Data Type

Modeling Type

1

Date

m/d/y

Numeric

Continuous

2

Calories

Calories Burned

Best

Numeric

Continuous

3

Calories

Calories Consumed

Best                 

Numeric

Continuous

4

Calories

Excess Calories Eaten  (JMP formula column = Calories Consumed - Calories Burned)

Best

Numeric

Continuous

5

Activity

Physical Activity

hr:m

Numeric

Continuous

6

Activity

Steps

Best

Numeric

Continuous

7

Activity

Average Mets

hr:m

Numeric

Continuous

8

Activity

Sedentary (up to 3 METs)

hr:m

Numeric

Continuous

9

Activity

Moderate (3-6 METs)

hr:m

Numeric

Continuous

10

Activity

Vigorous (6 METs +)

hr:m

Numeric

Continuous

11

Compliance

Time Onbody

hr:m

Numeric

Continuous

12

Compliance

Percent Onbody

Percent

Numeric

Continuous

13

Compliance

Lying Down

hr:m

Numeric

Continuous

14

Sleep

Lying Down

hr:m

Numeric

Continuous

15

Sleep

Sleep Duration

hr:m

Numeric

Continuous

16

Sleep

Sleep Efficiency

Percent

Numeric

Continuous

17

Sleep

Date of Sleep

Character

Nominal

18

Macros

% from Protein

Percent

Numeric

Continuous

19

Macros

% from Carbs

Percent

Numeric

Continuous

20

Macros

% from Fat

Percent

Numeric

Continuous

21

Macros

% from Alcohol

Percent

Numeric

Continuous

22

Weight

Weight Reading Date

m/d/y

Numeric

Continuous

23

Weight

Weight

Best

Numeric

Continuous

24

Weight

BMI

Best

Numeric

Continuous

25

Match flag

Character

Nominal

26

Year Week

Character

Nominal

27

Year Quarter

yyyyQq

Numeric

Continuous

28

Year

Best

Numeric

Ordinal

28

Month

Best

Numeric

Ordinal

28

Week

Best

Numeric

Ordinal

28

Day of Week

Best

Numeric

Ordinal

28

Day Name

Best

Numeric

Ordinal

 

 

 

Import BodyMedia® Food Log files from text

If you have access to Food log files exported from the BodyMedia® Activity Manager software, you can use the tools described below to import them. 

Requirements:

 

  • To use this item, you must have access to one or more Food log files in text format.  These files have a specific structure that the add-in recognizes.
  • All your exported food log text files must be saved into a single directory, and you should not save text files of any other type in the same directory.  Currently, the add-in will prompt for a directory and import all the text files it contains into a single JMP data table.  Text files of other types should be ignored, but it’s possible that the presence of incomplete exported files or other files with variable names that match those in BodyMedia files could cause problems with output.
  • If you are collecting your own data using a BodyMedia® FIT® armband, have an active subscription to the Activity Manager software, and are logging the foods you eat at meals, you may export new Food log files at any time by clicking the Report link on the Dashboard page for any day.
  • Alternatively, you can use this add-in to import one or more Food log files exported from BodyMedia®’s Activity Manager software by you or another software subscriber.

    To import text versions of your BodyMedia® Food log files into JMP, you must first export your food log files in PDF format from BodyMedia®'s web-based Activity Manager software.  You can do this by clicking on Report on the Activity Manager Dashboard page and selecting date ranges in weekly increments from 7-28 days.  Click the Food log Report button to create a PDF file for each date range.

Save Food log Report.png

I recommend exporting files in 28 day increments to minimize the number of files you will need to save.  By default, exported data files are saved with the current day's date in the title. When I export my own files, I always save them with a new name that includes the date range of the data in the file.  This helps minimize the chance of accidentally overwriting files when I am exporting data for multiple months on the same day.

To convert each of your exported BodyMedia® PDF food log files into text prior to import into JMP, open each file in Adobe Acrobat or Adobe Acrobat Reader and choose File > Save As Other > Text.  Make sure to save all your food log text files into a single directory.  Import from multiple different directories is not supported at this time.

After you have exported your BodyMedia® files, click Add-Ins > Fitness and Food > BodyMedia® > Import food log files from text to begin the import of your files into JMP.  This will launch a directory chooser asking you to specify the directory where your text formatted food log files are saved.  All files must be converted from PDF to text and the text files saved in a single directory to use this add-in to import them. Please make sure that the directory doesn't contain any other types of text files. The add-in doesn't currently check text files to verify that only files exported from BodyMedia® are present, so if you have unrelated text files in the specified directory, you may get unexpected results when you import.

Structure of Imported and Combined Activity Data Table

Below is a list of columns that should be imported from the text copies of your BodyMedia® food log files, which includes the original unparsed data along with additional columns that contain variables parsed into separate columns during the import process.  The names of the variables containing parsed data are shown below in bold.

  

Column

Column Group

Column Name

JMP format

Data Type

Modeling Type

1

Date

m/d/y

Numeric

Continuous

2

Meal

Character

3

Calories

Best

Numeric

Continuous

4

Fat

Best

Numeric

Continuous

5

Carb

Best

Numeric

Continuous

6

Protein

Best

Numeric

Continuous

7

Original Info

Lifestyle and Calorie Management System (unparsed data)

Character

8

Original Info

Original

Character

9

Original Info

Original File

Character

10

Original Info

Item Name

Character

11

Original Info

Serving Size

Character

12

Year Quarter

yyyyQq

Numeric

Continuous

13

Year Week

Character

Nominal

14

Year

Numeric

Ordinal

15

Month

Numeric

Ordinal

16

Week

Numeric

Ordinal

17

Day of Week

Numeric

Ordinal

18

Day Name

Numeric

Ordinal

 

 

Introduction to MyFitnessPal  Food Log Import Tool

 

Requirements:

 

  • To use this item, you must have exported food log files exported from MyFitnessPal (MFP) in CSV format using the free My Fitness Pal Data Downloader extension to the Google Chrome browser. This extension exports files with a specific structure that the add-in recognizes.
  • Currently, the add-in will prompt for a directory and import all the MyFitnessPal food log file(s) it contains into a JMP data table. You should not save CSV files of other types in the directory, as this could cause problems in your imported data table.
  • If you have an active subscription to the free MyFitnessPal (MFP) web site and are collecting your own food log data, you may export a new food log file at any time by following the detailed instructions below.
  • Alternatively, you can use this add-in to import one or more files exported from MFP software by you or another software subscriber.

  

Installing the Fitness and Food add-in adds an item to your JMP menu under Add-Ins > Fitness and Food > MyFitnessPal that can help you automatically import and combine food log files exported from this free web and app-based software tool for logging food eaten and exercise activities.  

 

If you log your data using the MFP app and website, you can export your food log data in CSV format by obtaining a free extension for Chrome from the Chrome app store called My Fitness Pal Data Downloader.  Once you install this tool, you can view it under the Tools item under the Chrome menu. After installing the extension, scroll to the bottom of your MFP Food Diary page and click the View Full Report (Printable) button. 

View full report.png

   

On the page that opens, specify the date range you are interested in and click the csv export button. 

MFP Date range.png

   

A CSV file downloaded in this way contains the same kind of basic information as a BodyMedia® food log report.  The JMP MFP add-in only works with the CSV text file format that is exported from the My Fitness Pal Data Downloader at this time. 

 

Tip:  If you wish to export a broader range of information from MFP, including exercise and measurement data, you may want to explore the use of another Chrome extension called MyFitnessPal Data Exporter by FOODFASTFIT.  It lets you export a single variable containing a single measure at a time into each exported file.  If you go this route, you will need to join a number of files containing different measures by date manually since the FOODFASTFIT export format is not supported by the current add-in.  This kind of file combination can be done easily in JMP by joining the files by date using the Join function under the Tables menu.

 

After you have exported your MyFitnessPal food log file, make sure that you have the Fitness and Food JMP Add-In installed.  If the add-in is installed, click on Add-Ins > Food and Fitness > MyFitnessPal > Import food log files from text to begin the import of your files into JMP.  This will launch a directory chooser asking you to specify the directory where your text formatted Food log files are saved.

 

Your MFP food log history file(s) must be saved as CSV to use this add-in. Please make sure that the directory doesn't contain any other types of CSV files. The add-in doesn't currently check file structure to verify that only files exported from My Fitness Pal are present, so if you have unrelated text files in the specified directory, you may get unexpected results when you import.

 

Structure of Imported and Combined Activity Data Table

 

Below is a list of columns that should be imported from the text copies of your MyFitnessPal food log file, including the original unparsed data and additional columns with variables parsed into separate columns during the import process.  The names of the variables containing parsed data are shown below in bold.

 

Column

Column Group

Column Name

JMP format

Data Type

Modeling Type

1

Date

m/d/y

Numeric

Continuous

2

Meal

Character

3

Calories

Best

Numeric

Continuous

4

Fat

Best

Numeric

Continuous

5

Carb

Best

Numeric

Continuous

6

Protein

Best

Numeric

Continuous

7

Cholest

Best

8

Sodium

Best

12

Sugars

Best

13

Fiber

Best

14

Original Info

Foods

Character

15

Original Info

Serving Size

Character

16

Year Quarter

yyyyQq

Numeric

Continuous

17

Year Week

Character

Nominal

18

Year

Numeric

Ordinal

19

Month

Numeric

Ordinal

20

Week

Numeric

Ordinal

21

Day of Week

Numeric

Ordinal

22

Day Name

Numeric

Ordinal

 

Please send me a note in the user community with any comments, questions or suggestions.  Thanks and happy tracking!

 

Article Tags