readgdx: readgdx

Description Usage Arguments Value Examples

View source: R/read.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
## 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)

## End(Not run)

gdxdt documentation built on Dec. 1, 2019, 1:14 a.m.