Polyphenol Estimator
This start guide shows you how to take your ASA24 or NHANES dietary data and estimate polyphenol intake using the FooDB and calculate the dietary inflammatory index1. Example ASA24 data, borrowed from the DietDiveR Repository2, is provided for you to test. Check out the example file here to see the input structure required for Polyphenol Estimator.
1. Download the entire repository directly here then unzip the folder.
The repository contains files and scripts used in the tutorial.
2. Open ‘run_pipeline.R’ in RStudio.

3. Update diet_input_file path if not using the demo ASA24 data.

4. Run the scripts.
In our usage case of ASA24 data, we have specified that the input is ASA24 data and that we would not like a report of what happens in each step. After you’ve run estimate_polyphenols, you can also run calculate_DII. Calculation of DII is optional. The function automatically detects whether you’ve run ASA24 or NHANES data, you only need to specify if you would like to see what happens in each script.
5. Check out the resulting files in your output directory!
Find a list of expected outputs below:
Reports: See What's in Each Script
- For every script that was run, a report was generated in the reports folder. This online tutorial actually shows you what the reports look like if you navigate to pages under "Polyphenol Estimator" and "DII Calculation" in your sidebar.
Want to test NHANES data instead?
estimate_polyphenols can also be run on NHANES WWEIA data. To generate NHANES WWEIA data, follow the instructions in “Preparing Diet Data - NHANES diet recalls”. When you’ve finished:
- Come back to run_pipeline.R and update
diet_input_filewith the NHANES output file name. - In
estimate_polyphenols, change type to “NHANES” - Run the script.