add_area_id: Change 'area_id' from one hierarchy level to another

View source: R/util.R

add_area_idR Documentation

Change area_id from one hierarchy level to another

Description

Function to change area_id from one hierarchy level to another.

Usage

add_area_id(df, df_areas_wide, par, add_keep_cols = NULL)

Arguments

df

Dataframe with area_id column.

df_areas_wide

sf dataframe with shapefiles and area hierarchy.

par

list with two entries:

  • area_levCurrent area level of df.

  • area_lev_selectDesired area level for df.

add_keep_cols

Additional columns to keep when summarising, Default: NULL

Value

df with area_id changed to area_lev_select.


mrc-ide/threemc documentation built on Feb. 9, 2024, 5:16 p.m.