Learn R Programming

healthiar

Introduction

healthiar is an R package to quantify and monetize health impacts attributable to exposure (e.g. air pollution, noise...) in a study area. Using healthiar, you can ...

  • Quantify health impacts choosing among multiple input data formats and calculation pathways:

    • Exposure data as single value or as distribution

    • Relative risk or absolute risk

    • Fixed-shape or user-defined exposure-response functions

    • Single or age-specific baseline health data (life table approach)

  • Iterate across geographical units

  • Compare scenarios

  • Include and summarize uncertainties

  • Monetize health impacts or perform cost-benefit analyses adjusting for inflation and discounting

  • Consider social inequalities in the assessment and stratify the results

Getting started

You have different materials to learn about the R package healthiar.

Cheat sheet

Have a quick and visual look at the cheat sheet

Vignette

Read the vignette (~ package manual) intro_to_healthiar, which you you can access

a) on the package website (recommended)

b) in R Studio: Click on the Packages tab in RStudio, scroll down to the healthiar package and clicking on the hyperlinks healthiar > User guides, package vignettes and other documentation

c) in the web browser: Run browseVignettes("healthiar") in the R console and the page will open up in your browser

Function documentation

See the function help pages for information about specific functions. In RStudio, you can access the function documentation of e.g. the function attribute_health by

a) going to the reference page of the package website

b) running ?attribute_health in RStudio (with healthiar loaded)

c) going to the Packages tab and then clicking on healthiar

Video

Watch a 45 minutes video from an online international workshop (30 September 2025), which can be found here. The slides of the presentation can be found here.

Installation

We recommend to frequently install the newest healthiar version. Please note that healthiar requires R version 4.3.0 or higher. There are two options to install healthiar:

a) From CRAN: Click on the Packages tab in RStudio and on the Install button. Leave the Install from: option set to Reporsitory (CRAN) and then search and select healthiar and finally click on Install, keeping Install dependencies activated.

b) From Github (most recent version): Run the following commands below in RStudio to install healthiar:

  • install.packages(c("knitr", "rmarkdown"))
  • remotes::install_github(repo = "SwissTPH/healthiar", build_vignettes = TRUE)
  • Note: install or update all package dependencies (= other packages that are needed for healthiar) if you get asked to do so

After installation, do not forget to load the package by running the call library(healthiar).

Citation

We love that you use healthiar. In that case, please do not forget to cite healthiar in your work. Three options to get there:

a) On the healthiar package website

b) See CITATION.R

c) In your R console, enter citation("healthiar").

In options b) and c), you always see the updated citation. In option a), you see citation of the healthiar version that you have installed locally, which might be outdated.

Disclamer and licence

By using healthiar, you confirm that you agree with the following disclaimer and terms of the licence:

a) Disclaimer: The R package healthiar is work in progress and the developers are not liable for the results.

b) License: Available here.

Feedback

Feel free provide feedback via GitHub issues

Presenting healthiar

If you would like us to present healthiar at a conference, lecture or training, please, contact us: alberto.castrofernandez@swisstph.ch and axel.luyten@swisstph.ch

Acknowledgements

healthiar was been developed under the framework of EU project BEST-COST. BEST-COST is funded by the European Union’s Horizon Europe programme under Grant Agreement No.101095408.

Copy Link

Version

Install

install.packages('healthiar')

Monthly Downloads

467

Version

0.2.3

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Alberto Castro

Last Published

February 19th, 2026

Functions in healthiar (0.2.3)

discount

Discount health impacts
exdat_lifetable

Population data per age and sex in Switzerland
exdat_socialize

Municipalities in Belgium ranked by BEST-COST Multidimensional Deprivation Index (MDI)
exdat_cantons

PM2.5 exposure and COPD incidence in Switzerland
get_input_args

get_input_args
get_inflation_factor

Get inflation factor
get_discount_factor

Get discount factor
find_multi_value_col_names

Find columns with multiple values
find_joining_columns

Find joining columns
get_pif

Get potential impact fraction (PIF)
multiexpose

Aggregate health impacts from multiple exposures
monetize

Monetize health impacts
get_risk_and_pop_fraction

Get input data and PAF
get_pop_fraction

Get population attributable or impact fraction
healthiar-package

healthiar: Quantifying and Monetizing Health Impacts Attributable to Exposure
prepare_mdi

Create the BEST-COST Multidimensional Deprivation Index (MDI)
socialize

Consider socio-economic aspects in the attributable health impacts
get_ref_prop_pop

Calculates reference proportion of population
get_impact

Attributable health cases based on relative risk
get_impact_with_lifetable

Get population impact over time
prepare_lifetable

Convert multi-year life table to single year life table
get_risk

Get the relative risk of an exposure level
prepare_exposure

Prepare exposure data
summarize_uncertainty

Get Monte Carlo confidence intervals
standardize

Obtain age-standardized health impacts
validate_input_attribute

Check the input_args data of attribute_master()
get_paf

Get population attributable fraction
exdat_ozone

PM2.5 exposure and COPD incidence in Switzerland
get_output

Obtain and store output
attribute_lifetable

Attribute premature deaths or YLL to an environmental stressor using a life table approach
attribute_mod

Create a scenario 2 by modifying an existing scenario 1 and determine attributable health impacts in it
cba

Cost-benefit analysis
check_if_args_identical

Check if arguments are identical before stop
compile_input

Compile input
attribute_health

Attribute health impacts to an environmental stressor
compare

Compare the attributable health impacts between two scenarios
daly

Attributable disability-adjusted life years
exdat_pwm_1

Air pollution expsoure data of the Brussels-Capital region (Belgium)
exdat_pm

PM2.5 exposure and COPD incidence in Switzerland
add_info

Add meta-information to the data frame containing the input data
exdat_pwm_2

Geospatial outlines and populations of the Brussels-Capital region (Belgium)
exdat_noise

Noise exposure in urban and rural regions in Norway
exdat_prepare_mdi

Social indicators of the BEST-COST Multidimensional Deprivation Index (MDI)
collapse_df_by_group

Collapse rows by grouping columns
attribute_master

Attributabe health impact to an environmental stressor