Description Usage Format Examples
Nutrient values and information about the values, including expanded statistical information.
1 |
A data frame with 632,894 observations and 18 variables:
Food identifier. Joins with food
Nutrient identifier. Joins with nutrient_def
Amount of nutrient in 100g.
Number of analyses used to compute value. If the number of data points is 0, the value was calculated or imputed.
Standard error of the mean. NA if cannot be calculated. The standard error is also not given if the number of data points is less than three
Code indicating type of data. Joins with
source_type
Data derivation code. Joins with deriv
Food identifier for the item used to calculate a missing value. Populated only for items added or updated starting with SR14.
Indicates a vitamin or mineral added for fortification or enrichment. This field is populated for ready-to-eat breakfast cereals and many brand-name hot cereals in food group 8.
Number of studies.
Minimum & maximum value from studies
degrees of freedom
Lower and upper 95% CI around mean
Statistical comments
Month value added or modified
Confidence Code indicating data quality, based on evaluation of sample plan, sample handling, analytical method, analytical quality control, and number of samples analyzed. Not included in this release, but is planned for future releases.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | nutrient
# To find a name nutrient information for a specified food, you need to
# join food, nutrient and nutrient_def
if (require("dplyr") && require("tidyr")) {
nutr_info <- food %>%
select(food_id, food) %>%
inner_join(nutrient %>% select(food_id, nutr_id, value)) %>%
inner_join(nutrient_def %>% select(nutr_id, nutr_abbr))
# Often easiest to understand if you spread the nutrient values out
# in to columns. We'll do this for the 10 most prevalent nutrients
top_nutr <- nutrient %>%
group_by(nutr_id) %>%
tally(sort = TRUE) %>%
head(10)
nutr_info %>%
semi_join(top_nutr) %>%
select(food_id, food, nutr_abbr, value) %>%
spread(nutr_abbr, value)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.