load_model {gEcon}R Documentation

Load model from .model.R file

Description

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

Usage

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

# 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)

[Package gEcon version 1.1.0 Index]