Describing Data#
The methods describeSets, describeParameters, describeVariables, and describeEquations allow the user to get a summary view of key data statistics. The returned data frame aggregates the output for a number of other methods (depending on symbol type). A description of each Container method is provided in the following subsections.
describeSets#
Argument |
Type |
Description |
Required |
Default |
|---|---|---|---|---|
|
|
A list of sets in the Container to include in the output. describeSets will include aliases if they are explicitly passed by the user. |
No |
|
Returns: data frame
The following table includes a short description of the column headings in the return.
Field / Statistic |
Description |
|---|---|
|
name of the symbol |
|
|
|
domain labels for the symbol |
|
|
|
dimension |
|
number of records in the symbol |
|
|
Example #1#
library(gamstransfer)
m <- Container$new("trnsport.gdx")
> m$describeSets()
name isSingleton domain domainType dimension numberRecords sparsity
1 i FALSE * none 1 2 NA
2 j FALSE * none 1 3 NA
Example #2 – with aliases#
library(gamstransfer)
m <- Container$new()
i <- Set$new(m, "i", records = paste0("i", 1:10))
j <- Set$new(m, "j", records = paste0("j", 1:10))
ip <- Alias$new(m, "ip", i)
jp <- Alias$new(m, "jp", j)
> m$describeSets()
name isSingleton domain domainType dimension numberRecords sparsity
1 i FALSE * none 1 10 NA
2 j FALSE * none 1 10 NA
> m$describeSets(append(m$listSets(), m$listAliases()))
name isSingleton domain domainType dimension numberRecords sparsity
1 i FALSE * none 1 10 NA
3 ip FALSE * none 1 10 NA
2 j FALSE * none 1 10 NA
4 jp FALSE * none 1 10 NA
describeParameters#
Argument |
Type |
Description |
Required |
Default |
|---|---|---|---|---|
|
|
A list of parameters in the Container to include in the output |
No |
|
Returns: data frame
The following table includes a short description of the column headings in the return.
Field / Statistic |
Description |
|---|---|
|
name of the symbol |
|
domain labels for the symbol |
|
|
|
dimension |
|
number of records in the symbol |
|
min value in data |
|
mean value in data |
|
max value in data |
|
row number min value (if multiple, returns only first occurrence) |
|
|
library(gamstransfer)
m <- Container$new("trnsport.gdx")
> m$describeParameters()
> name domain domainType dimension numberRecords min mean max
1 a i regular 1 2 350.000 475.0000 600.000
2 b j regular 1 3 275.000 300.0000 325.000
5 c i j regular 2 6 0.126 0.1755 0.225
3 d i j regular 2 6 1.400 1.9500 2.500
4 f NA none 0 1 90.000 90.0000 90.000
whereMin whereMax sparsity
1 1 2 0
2 3 1 0
5 6 1 0
3 6 1 0
4 1 1 NA
describeVariables#
Argument |
Type |
Description |
Required |
Default |
|---|---|---|---|---|
|
|
A list of variables in the Container to include in the output |
No |
|
Returns: data frame
The following table includes a short description of the column headings in the return.
Field / Statistic |
Description |
|---|---|
|
name of the symbol |
|
type of variable (i.e., |
|
domain labels for the symbol |
|
|
|
dimension |
|
number of records in the symbol |
|
|
|
min value in the |
|
mean value in the |
|
max value in the |
|
max absolute value in the |
library(gamstransfer)
m <- Container$new("trnsport.gdx")
> m$describeVariables()
name type domain domainType dimension numberRecords sparsity minLevel
1 x positive i j regular 2 6 0 0.000
2 z free NA none 0 1 NA 153.675
meanLevel maxLevel whereMaxAbsLevel
1 150.000 300.000 2
2 153.675 153.675 1
describeEquations#
Argument |
Type |
Description |
Required |
Default |
|---|---|---|---|---|
|
|
A list of equations in the Container to include in the output |
No |
|
Returns: data frame
The following table includes a short description of the column headings in the return.
Field / Statistic |
Description |
|---|---|
|
name of the symbol |
|
type of variable (i.e., |
|
domain labels for the symbol |
|
|
|
dimension |
|
number of records in the symbol |
|
|
|
min value in the |
|
mean value in the |
|
max value in the |
|
max absolute value in the |
library(gamstransfer)
m <- Container$new("trnsport.gdx")
> m$describeEquations()
name type domain domainType dimension numberRecords sparsity minLevel
1 cost eq NA none 0 1 NA 0
3 demand geq j regular 1 3 0 275
2 supply leq i regular 1 2 0 350
meanLevel maxLevel whereMaxAbsLevel
1 0 0 1
3 300 325 1
2 450 550 2