read_gdx | R Documentation |
Read gdx files in a tidy way
read_gdx(
files,
symbol = NULL,
col_names = NULL,
attributes = "l",
data_type = "tb",
factors_as_strings = TRUE,
names = NULL,
names_to = "name"
)
files |
path to one or several gdx files |
symbol |
symbol name to read in the gdx. If NULL (default) returns a data.frame of the list of symbols in the gdx. |
col_names |
a vector of optional names for the columns. |
attributes |
character vector: the attributes to keep for variables, equations and sets. Possible values are '"l"' (the default) specifies the level, '"m"' specificies the marginal, '"lo"' specificies the lower bound, '"up"' specifies the upper bound, '"s"' specificies the scale, and '"te"' specified the text for sets. |
data_type |
character string: the type of data to output. Possible values are '"tb"' (the default) for a tibble, '"dt"' for a data.table, and '"df"' for a data.frame. |
factors_as_strings |
logical (default is TRUE) specifying whether factors should be transformed in strings. |
names |
a vector of optional names in case several gdx files are imported. The default is to use the gdx file name. |
names_to |
character string (default: '"name") specifying the new column to create to store the file names. |
A 'tibble()', a 'data.table', or a 'data.frame'.
fpath <- system.file("extdata", "trnsport.gdx", package = "gamsr")
read_gdx(fpath, "a")
read_gdx(fpath)
read_gdx(fpath, "x")
read_gdx(fpath, "f")
read_gdx(fpath, "i", attributes = "te")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.