`gdxreshape()` formats the data to be saved in GDX into long format. It is imported from the gdxrrw package with a few improvements for performance and usability, since there is a risk of it being removed from the gdxrrw package in the future. We would like to thank the R GAMS team for this useful function.

`gdxreshape()` formats the data to be saved in GDX into long format. It is imported from the gdxrrw package with a few improvements for performance and usability, since there is a risk of it being removed from the gdxrrw package in the future. We would like to thank the R GAMS team for this useful function.

gdxreshape(
  inDF,
  symDim,
  symName = NULL,
  tName = "time",
  gdxName = NULL,
  setsToo = TRUE,
  order = NULL,
  setNames = NULL
)

gdxreshape(
  inDF,
  symDim,
  symName = NULL,
  tName = "time",
  gdxName = NULL,
  setsToo = TRUE,
  order = NULL,
  setNames = NULL
)

Arguments

inDF

wide dataframe.

symDim

wide dataframe.

symName

wide dataframe.

tName

wide dataframe.

gdxName

wide dataframe.

setsToo

wide dataframe.

order

wide dataframe.

setNames

wide dataframe.

Value

A tibble `tbl_df`.

A tibble `tbl_df`.

See also

  • wgdx]Write R data to GDX

  • wgdx.lst]Write multiple symbols to GDX

  • wgdx.reshape]Write multiple symbols to GDX

  • pivot_longer]Make dataframes longer

  • wgdx]Write R data to GDX

  • wgdx.lst]Write multiple symbols to GDX

  • wgdx.reshape]Write multiple symbols to GDX

  • pivot_longer]Make dataframes longer

Examples

BINDir <- "inst/extdata/GAMS"
datafile <- 'FarmDynRexampledata.gdx'
gdxbinwider(datafile, BINDir, 'map2binid', 'mapping')
#> Error in rgdx(gdxName, list(name = symName, compress = compress, ts = ts),     squeeze = squeeze, useDomInfo = useDomInfo): GDX file 'inst/extdata/GAMS/FarmDynRexampledata.gdx' not found
BINDir <- "inst/extdata/GAMS"
datafile <- 'FarmDynRexampledata.gdx'
gdxbinwider(datafile, BINDir, 'map2binid', 'mapping')
#> Error in rgdx(gdxName, list(name = symName, compress = compress, ts = ts),     squeeze = squeeze, useDomInfo = useDomInfo): GDX file 'inst/extdata/GAMS/FarmDynRexampledata.gdx' not found