README.md

NOTE: This is a toy package created for the medium test of the project Network Analysis for Input-Output Tables.

IOcoef

R-CMD-check

The goal of IOcoef is to calculate the consumption coefficient in the input-output table.

Installation

You can install the development version of IOcoef from GitHub with:

# install.packages("devtools")
devtools::install_github("Carol-seven/IOcoef")

Example

A fairly common task when dealing with input-output table is the need to compute the direct and complete consumption coefficient. This is what IOcoef::iocoef() do.

library(IOcoef)
adj <- matrix(sample(25), 5, 5)
X <- as.vector(101:105)
iocoef(adj, X, type = "direct")
#>            [,1]       [,2]       [,3]       [,4]       [,5]
#> [1,] 0.06930693 0.05882353 0.12621359 0.03846154 0.18095238
#> [2,] 0.21782178 0.22549020 0.14563107 0.23076923 0.16190476
#> [3,] 0.08910891 0.15686275 0.24271845 0.10576923 0.17142857
#> [4,] 0.11881188 0.13725490 0.09708738 0.01923077 0.07619048
#> [5,] 0.20792079 0.19607843 0.04854369 0.02884615 0.00952381
iocoef(adj, X, type = "complete")
#>           [,1]      [,2]      [,3]      [,4]      [,5]
#> [1,] 0.2629619 0.2712878 0.3044700 0.1561892 0.3397898
#> [2,] 0.6127512 0.6568644 0.5155075 0.4844523 0.5092666
#> [3,] 0.4132246 0.5190389 0.5593643 0.3198758 0.4548317
#> [4,] 0.3119530 0.3487860 0.2828604 0.1518120 0.2515620
#> [5,] 0.4157610 0.4205441 0.2506292 0.1779133 0.2113783


Carol-seven/IOcoef documentation built on April 4, 2022, 12:38 a.m.