get_shock_names_by_index: Shocks corresponding to given indices

Description Usage Arguments Details Value Examples

View source: R/class_model_shock.R

Description

The get_shock_names_by_index function allows to retrieve the names of shocks with given indices.

Usage

1
get_shock_names_by_index(model, index_names)

Arguments

model

an object of gecon_model class.

index_names

a character vector of indices.

Details

Cf. gEcon users' guide, chapter ‘Templates’.

Value

The function returns a character vector of relevant shocks' names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# copy the example to the current working directory
file.copy(from = file.path(system.file("examples", package = "gEcon"),
          "home_production_templ.gcn"), to = getwd())

# make and load the model
home_prod_templ <- make_model("home_production_templ.gcn")

# get shocks affecting home production technology
hp_shocks <- get_shock_names_by_index(home_prod_templ, "H")

# print information about selected shocks
shock_info(home_prod_templ, hp_shocks)

gEcon documentation built on May 2, 2019, 6:52 p.m.