View source: R/matrix_extract.R
set_zero | R Documentation |
Sets to zero specific rows and columns of a matrix, to include and exclude specific geographical and sector effects.
set_zero(df, orig = NULL, dest = NULL, wiotype = NULL, invert = FALSE)
df |
A matrix with named rows and columns. |
orig |
A vector of integers with position of rows or a list of strings with codes of country and sector of origin. |
dest |
A vector of integers with position of columns or a list of strings with codes of country and sector of destination. |
wiotype |
String, type of |
invert |
Boolean: FALSE (default) to set to zero the specified countries and sectors, or TRUE to set to zero the non-specified countries and sectors. |
The same matrix with specific rows and columns set to zero.
wio <- make_wio("wiodtest")
# Set to zero Spanish exports of intermediates of manufacturing to
# non EU27 countries (for any sector of destination) in the coefficient
# matrix A
set_zero(wio$A, list("ESP", "MANUF"), list("NONEU27", "TOTAL"), "wiodtest")
# Set to zero Spanish exports of intermediates (extraction matrix of Spain)
set_zero(wio$A, list("ESP", "TOTAL"), list("WLDxESP", "TOTAL"), "wiodtest")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.