Skip to contents

Identify the column position corresponding to final household expenditure in a symmetric input–output table or related table.

Usage

household_column_find(data_table)

Arguments

data_table

A symmetric input–output table, a use table, or a supply table.

Value

An integer vector giving the position(s) of household expenditure columns. Returns NULL if none are found.

Details

The function searches column names case-insensitively. It first looks for exact matches among the following alternatives:

  • "households"

  • "p3_s14"

  • "final_consumption_households"

  • "final_consumption_household"

  • "consumption_expenditure_household"

  • "consumption_expenditure_households"

If none of these are found, it falls back to any column name that contains "households".

Examples

# German SIOT includes a household final consumption column
household_column_find(iotable_get(source = "germany_1995"))
#> [1] 9

# Custom example
df <- data.frame(
  sector = c("A", "B"),
  households = c(100, 200)
)
household_column_find(df)
#> [1] 2