IO for GAMS GDX Files using 'data.table'

Interfaces GAMS data (*.gdx) files with 'data.table's using the GAMS R package 'gdxrrw'. The 'gdxrrw' package is available on the GAMS wiki: < https://support.gams.com/doku.php?id=gdxrrw:interfacing_gams_and_r>.


gdxdt

Read/Write utilities for GAMS gdx files. Using R's data.table.

Requires GAMS gdxrrw library downloadable from the GAMS wiki.

Install

require(devtools)
install_github("loisel/gdxdt")

gdxdt depends on the gdxrrw library. To use this library you have to set the gams library path via igdx.

Usage

Read parameter, variable or set with symbol name:

dt <- readgdx("filename.gdx", "name")

Read upper bound field of variable, field="l" is the default:

dt <- readgdx("filename.gdx", "variable", field="up")

Write parameter:

dt <- data.table(
	col1=c("a", "b", "c"),
	col2=c("d", "e", "f"))
dt[, value:=runif(1), by="col1"]

writegdx.parameter("test.gdx", dt,
	name="test",
	valcol = "value",
	uelcols = c("col1", "col2"))

Write variable:

dt <- data.table(
	col1=c("a", "b", "c"),
	col2=c("d", "e", "f"))
dt[, value:=runif(1), by="col1"]

writegdx.variable("test.gdx", dt,
	name="test",
	valcol = "value",
	uelcols = c("col1", "col2"),
	field="l")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gdxdt")

0.1.0 by Alois Dirnaichner, 7 years ago


Browse source code at https://github.com/cran/gdxdt


Authors: Alois Dirnaichner [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENCE license


Depends on data.table

Suggests gdxrrw, testthat


See at CRAN