load_model: Load model from '.model.R' file

Description Usage Arguments Details Value See Also Examples

View source: R/gecon.R

Description

The load_model function loads the already generated .model.R file and creates an object of the gecon_model class.

Usage

1
load_model(filename)

Arguments

filename

the path to the .model.R file containing the model's functions and variables. The .model.R extension is optional.

Details

The .model.R file with the model specification has to be created first. It can be done with the make_model function taking a .gcn file with model specification as an argument.

Value

An object of the gecon_model class representing the model. Generic functions such as print and summary allow to show the model's elements.

See Also

The make_model function in order to create an .R file with the model specification.

Examples

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

# make and load the model
rbc <- make_model("rbc.gcn")
print(rbc)
# load the already generated model
rbc2 <- load_model("rbc.model.R")
print(rbc2)

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

Related to load_model in gEcon...