sfcr_matrix_display: Print matrix to screen

Description Usage Arguments Details Note Author(s) Examples

View source: R/sfcr_matrix_display.R

Description

Print matrix to screen

Usage

1

Arguments

matrix

A balance sheet or transactions-flow matrix

which

A character string for the matrix. Is it a balance-sheet or a transactions-flow matrix? here are two options: "bs" for balance-sheet matrices, and "tfm" for transactions- flow matrices. The default is "tfm".

Details

This function takes a matrix as input and generate a kableExtra table with math symbols displayed in latex style.

Note

This function converts the math expressions used to build the sfcr_matrix into a latex format, but cannot add modifications to it. The user is invited to explore the source code and the kableExtra package in order to personalize his/her own matrices.

Author(s)

João Macalós

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Balance-sheet matrix

bs_insout <- sfcr_matrix(
  columns = c("Households", "Firms", "Government", "Central bank", "Banks", "Sum"),
  codes = c("h", "f", "g", "cb", "b", "s"),
  r1 = c("Inventories", f = "+INV", s = "+INV"),
  r2 = c("HPM", h = "+Hhd", cb = "-Hs", b = "+Hbd"),
  r3 = c("Advances", cb = "+As", b = "-Ad"),
  r4 = c("Checking deposits", h = "+M1h", b = "-M1s"),
  r5 = c("Time deposits", h = "+M2h", b = "-M2s"),
  r6 = c("Bills", h = "+Bhh", g = "-Bs", cb = "+Bcb", b = "+Bbd"),
  r7 = c("Bonds", h = "+BLh * pbl", g = "-BLs * pbl"),
  r8 = c("Loans", f = "-Ld", b = "+Ls"),
  r9 = c("Balance", h = "-V", f = 0, g = "+GD", cb = 0, b = 0, s = "-INV")
)

sfcr_matrix_display(bs_insout, "bs")

sfcr documentation built on Oct. 11, 2021, 9:09 a.m.