wgdx.reshape | R Documentation |
Reshape the input data frame (assumed to be in "wide" form) into a "long" form
suitable for passing to wgdx.lst
or wgdx.df
.
wgdx.reshape(inDF, symDim, symName=NULL, tName="time",
gdxName=NULL, setsToo=TRUE, order=NULL,
setNames=NULL)
inDF |
data frame in "wide" form |
symDim |
dimension of the output GDX symbol |
symName |
name of the output GDX symbol |
tName |
index set name for the new index position created by reshaping |
gdxName |
name of the GDX file to write |
setsToo |
if TRUE, extract the index sets defined by |
order |
specify the selection and ordering of the index columns when reshaping |
setNames |
specify explanatory text for the extracted index sets |
A common problem is failure to load the external GDX libraries that
are required to interface with GDX data. Use igdx
to
troubleshoot and solve this problem.
There is also the issue of our dependence on the reshape
package. This still needs to be tightened up.
This routine is experimental/prototype work and perhaps temporary. Don't use it for production work.
Original coding by Steve Dirkse. Maintainer: R@gams.com
wgdx
, igdx
, rgdx
, gdxInfo
# take a sample dataset and reshape it
str(airquality);
oList <- wgdx.reshape (airquality, 3, symName="airquality",
tName = "dataType", order=c(5,6,0))
## Not run:
# send the data to GDX
wgdx.lst("airquality", oList)
## End(Not run)
## Not run:
# complete tests and examples can be run in the
# extdata directory of the gdxrrw package
# check .libPaths for a hint on where packages are installed
setwd(paste(.libPaths()[1],"/gdxrrw/extdata",sep=""))
source("tAll.R")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.