weight: Weight.

Description Usage Format Examples

Description

This file (Table 12) contains the weight in grams of a number of common measures for each food item.

Usage

1

Format

A data frame with 15,137 observations and 7 variables:

food_id

Food identifier. Joins to food

seq

Sequence number.

amount

Unit modifier (e.g. 1 in 1 cup)

desc

Description (for example, cup, diced, and 1-inch pieces).

weight

Weight in grams.

num_points

Number of data points.

sd

Standard deviation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
weight

if (require("dplyr")) {
# Find out weight of a cup of x
cups <- weight %>%
  filter(desc == "cup") %>%
  select(food_id, weight)
food %>%
  select(food_id, food) %>%
  inner_join(cups)
}

hadley/usdanutrients documentation built on May 17, 2019, 1:31 p.m.