
Add a final-demand product-area stage to footprints.
Source:R/footprint_paths.R
add_footprint_product_stage.RdSplit footprint rows by the area that supplied the final-demand product,
using shares from y_mat. This preserves the standard footprint totals
while adding a FABIO-viewer style phase:
origin product -> product/supplier area -> product -> final-demand area.
This is a compact global-view helper. It does not recompute the full
origin-sector by product-sector Leontief cube. Instead, each existing
footprint row is allocated over the product-area shares observed in final
demand for the same target_area, target_fd, and target_item.
Usage
add_footprint_product_stage(
footprints,
y_mat,
labels,
fd_labels,
max_product_areas = 5,
other_area_name = "Other",
min_share = 0
)Arguments
- footprints
Footprint table from
compute_footprint()withtarget_area,target_item,target_fd, andvalue.- y_mat
Final demand matrix from
build_io_model().- labels
Tibble mapping Y rows to
area_codeanditem_cbs_code.- fd_labels
Tibble mapping Y columns to
area_codeandfd_col.- max_product_areas
Maximum number of supplier/product areas to keep separately for each final-demand area, item, and demand category. Smaller supplier areas are grouped into
other_area_name.- other_area_name
Label for grouped supplier/product areas.
Drop split paths smaller than this percentage of the total input footprint value. Use 0 to keep all split paths.