Learn R Programming

INSTALL THE healthiar R PACKAGE FROM GITHUB

(Requirement: R version 4.3.0 or higher)

Run the following commands below in RStudio to install healthiar

  1. install.packages(c("remotes", "knitr", "rmarkdown"))
  2. remotes::install_github(repo = "SwissTPH/healthiar", build_vignettes = TRUE)
  3. If you get asked to install or update any dependencies (= other packages that are needed for healthiar) please install or update all of them.
  4. library(healthiar)

We recommend to frequently install the newest healthiar version by running command 2) from above. (If you had previously installed healthiar while the repository was still private, you must remove your personal access token (PAT) before installing the package again.)

GET STARTED WITH healthiar

A 45' minutes introduction to the package can be found here: https://team.swisstph.ch/s/aN_wN5MUTAS3bwEkWvtvaQ

The slides of the presentation can be found here: https://github.com/SwissTPH/healthiar/tree/master/varia/Workshops_and_demos/workshop

The vignette intro_to_healthiar (i.e. documentation on how to use the healthiar package) will get you started with the healthiar R package.

  1. Open it in RStudio: go to the Packages tab in RStudio, scroll down to the healthiar package and clicking on the hyperlinks healthiar > User guides, package vignettes and other documentation > healthiar::intro_to_healthiar
  2. Open it in browser: run browseVignettes("healthiar") in the console and click on the HTML hyperlink on the page that opens up in your browser

FEEDBACK

Feedback is very welcome - please provide it via GitHub issues: https://github.com/SwissTPH/healthiar/issues

STAYING UPDATED

If you want to receive updates in the future about new developments or workshops of the healthiar R package, please leave your email at the end of the form (otherwise you will not receive such updates in the future).

WE OFFER healthiar INTRODUCTIONS

Would you like to be introduced to healthiar? In case you would like us to introduce the package at a conference or another event please get in touch: alberto.castrofernandez@swisstph.ch and axel.luyten@swisstph.ch

Copy Link

Version

Install

install.packages('healthiar')

Monthly Downloads

467

Version

0.2.1

License

GPL (>= 3)

Maintainer

Alberto Castro

Last Published

November 11th, 2025

Functions in healthiar (0.2.1)

cba

Cost-benefit analysis
compile_input

Compile input
daly

Attributable disability-adjusted life years
compare

Compare the attributable health impacts between two scenarios
attribute_lifetable

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

PM2.5 exposure and COPD incidence in Switzerland
attribute_master

Attributabe health impact to an environmental stressor
exdat_noise

Noise exposure in urban and rural regions in Norway
collapse_df_by_group

Collapse rows by grouping columns
exdat_prepare_mdi

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

Discount health impacts
get_inflation_factor

Get inflation factor
get_paf

Get population attributable fraction
exdat_pm

PM2.5 exposure and COPD incidence in Switzerland
get_discount_factor

Get discount factor
get_output

Obtain and store output
exdat_socialize

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

get_input_args
exdat_lifetable

Population data per age and sex in Switzerland
find_multi_value_col_names

Find columns with multiple values
check_if_args_identical

Check if arguments are identical before stop
get_pif

Get population impact fraction
get_risk

Get the relative risk of an exposure level
standardize

Obtain age-standardized health impacts
socialize

Consider socio-economic aspects in healthiar assessments
monetize

Monetize health impacts
exdat_cantons

PM2.5 exposure and COPD incidence in Switzerland
find_joining_columns

Find joining columns
get_pop_fraction

Get population attributable or impact fraction
get_risk_and_pop_fraction

Get input data and PAF
get_ref_prop_pop

Calculates reference proportion of population
get_impact_with_lifetable

Get population impact over time
prepare_mdi

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

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

Aggregate health impacts from multiple exposures
prepare_exposure

Prepare exposure data
summarize_uncertainty

Get Monte Carlo confidence intervals
get_impact

Attributable health cases based on relative risk
validate_input_attribute

Check the input_args data of attribute_master()
attribute_mod

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

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

Attribute health impacts to an environmental stressor