reiod: Dietary Environmental Impact Metrics from the Intake EIOD Framework
Source:R/reiod-package.R
reiod-package.RdCalculates the dietary environmental impact metrics defined in Intake's Environmental Impacts of Foods methods paper (January 2026).
What this package is not
`reiod` **does not contain the Environmental Impacts of Foods database.** It ships the published metric *cut-offs* and applies them to impact values you have already derived. Matching food items to impact factors, applying edible-portion, processing and cooking-yield adjustments, and summing to the respondent-day is upstream work that this package starts after. It also does not calculate the Global Diet Quality Score; the composite metrics take a GDQS value as input.
The three metric families
- Absolute threshold (Table 3)
[eiod_absolute_threshold()] - is the diet below the per capita daily share of a planetary boundary?
- Relative benchmark (Tables 4a-4g)
[eiod_relative_band()] - where does the diet sit in a fixed global reference distribution?
- Composite (Tables 5a, 5b)
[eiod_hesd()] and [eiod_hdlei()] - diet quality combined with environmental impact, each also returning its two criteria as separate sub-indicators.
All of them need the eight-category demographic group from [eiod_age_sex_group()].
Check your data first
[eiod_check_data()] covers variable type, plausibility, numerical precision and unit magnitude. Running it first is cheap and catches the failure modes that otherwise produce confidently wrong numbers.
Three things to know before reporting results
**Eutrophication is in grams PO4(3-)eq in every table.** Intake confirmed this in October 2026 and supplied corrected Table 3 thresholds, so eight rows of [eiod_cutoffs] differ from the published PDF (marked by its `value_source` column). Supply grams and convert nothing. See `vignette("eutrophication")`.
A **low relative band is not evidence of sustainability**. For greenhouse gases even band 1 exceeds the planetary boundary; for water even band 10 is below it.
**HDLEI is nested inside HESD** - every HDLEI diet is also a HESD diet. They are not two independent dimensions.
Dependencies
None beyond base R. `reiod` imports only `stats` and `utils`, which ship with every R installation, so it installs with no dependency tree. The consequence is a plain vector API rather than tidy evaluation: pass `df$biodiv`, not `biodiv`.
Author
Maintainer: Nicholus Tint Zaw nicholustintzaw@gmail.com (ORCID)
Authors:
Nicholus Tint Zaw nicholustintzaw@gmail.com (ORCID)
Examples
# one row per respondent-day, impact totals already summed
d <- eiod_demo
d$grp <- eiod_age_sex_group(d$age, d$sex)
# check the inputs before computing anything
summary(eiod_check_data(d, impacts = eiod_demo_map,
age = "age", sex = "sex", gdqs = "gdqs"))
#> PASS - 0 error, 0 warning, 33 note
# Table 3: share of diets below each absolute threshold, %
abs7 <- eiod_absolute_all(d, d$grp, eiod_demo_map)
round(100 * colMeans(abs7, na.rm = TRUE), 1)
#> abs_landtotal abs_landarable abs_landpasture abs_ghg abs_eutroph
#> 70.2 80.8 68.7 22.2 53.5
#> abs_water abs_biodiv
#> 95.2 57.1
# Tables 4a-4g: relative band for one indicator
table(eiod_relative_band(d$ghg_kgco2e, d$grp, "ghg"))
#>
#> 1 2 3 4 5 6 7 8 9 10
#> 249 30 65 78 29 1 4 63 23 58
# Tables 5a and 5b: composites
table(eiod_hesd(d$biodiv_pdf, d$gdqs, d$grp))
#> 15 observation(s) aged under 2 years set to NA: the GDQS is not validated below age 2, so the HESD metric does not apply to them.
#>
#> Healthy and env. sustainable Not healthy but env. sustainable
#> 206 125
#> Healthy but not env. sustainable Not healthy and not env. sustainable
#> 124 110
table(eiod_hdlei(d$biodiv_pdf, d$gdqs, d$grp))
#> 15 observation(s) aged under 2 years set to NA: the GDQS is not validated below age 2, so the HDLEI metric does not apply to them.
#>
#> Healthy with low env. impacts Not healthy but low env. impacts
#> 145 94
#> Healthy but not low env. impacts Not healthy and not low env. impacts
#> 185 141