Learn R Programming

gdxdt (version 0.1.0)

readgdx: readgdx

Description

Read a variable, parameter or set from a gdx file to a data.table.

Usage

readgdx(fname, varname, field = NULL)

Arguments

fname

the gdx filename.

varname

name of the object to load.

field

(for variable), select a field (default="l").

Value

a data.table

Examples

Run this code
# NOT RUN {
dt <- as.data.table(mtcars, keep.rownames = TRUE)
tmpgdx <- file.path(tempdir(), "test.gdx")
test_var <- "mtcars"
writegdx(tmpgdx, dt, test_var, valcol="wt", uelcols="rn", type="parameter")
new_dt <- readgdx(tmpgdx, test_var)
# }

Run the code above in your browser using DataLab