agg.sector: Aggregate Sectors

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/agg.sector.R


agg.sector takes specified sectors and creates a "new" joint sector. This produces a new InputOutput object. Note the Leontief Inverse and Ghoshian Inverse are elements. There is deliberately no warning if the sector does not occur in all regions. See locate.mismatch.

Caution: Inverting large matrices will take a long time. R does a computation roughly every 8e-10 second. The number of computations per matrix inversion is n^3 where n is the dimension of the square matrix. For n = 5000 it should take 100 seconds.


agg.sector(io, sectors, newname = "newname")



An InputOutput class object from as.inputoutput


Character. Specific sectors to be aggregated. Can either be a character that exactly matches the name of the sector in RS_label or the number of the sector in the order it appears in RS_label. May also be 'all' to select all sectors.


Character. The name to give to the new aggregated sector.


Creates the aggregation matrix to pre (and/or post when appropriate) to aggregate the matrices in the InputOutput object. Say you have 1 region with n sectors and you wish to aggregate sectors i and i+1. A diagonal matrix is converted into a n-1xn matrix where rows i and i+1 are additively combined together. This matrix is then used to create new aggregated tables. The "new" sector is then stored in location i. See Blair and Miller 2009 for more details.


A new InputOutput object is created. See as.inputoutput.


John J. P. Wade, Ignacio Sarmiento-Barbieri


Blair, P.D. and Miller, R.E. (2009). "Input-Output Analysis: Foundations and Extensions". Cambridge University Press

Nazara, Suahasil & Guo, Dong & Hewings, Geoffrey J.D., & Dridi, Chokri, 2003. "PyIO. Input-Output Analysis with Python". REAL Discussion Paper 03-t-23. University of Illinois at Urbana-Champaign. (

See Also

as.inputoutput, locate.mismatch, agg.region


newIO <- agg.sector(toy.IO, sectors = c(1,2), newname = "Party.Supplies")

Example output

Loading required package: ggplot2
Loading required package: plot3D
Loading required package: lpSolve
Warning message:
no DISPLAY variable so Tk is not available 
[1] "InputOutput"

ioanalysis documentation built on Jan. 13, 2021, 5:16 p.m.