Parsing

Edit

SLiDE.AddType
mutable struct Add <: Edit
    col::Symbol
    val::Any
end

Add new column col filled with val

Arguments

  • col::Symbol: name of new column
  • val::Any: value to add to new column
source
SLiDE.CombineType
mutable struct Combine <: Edit
    operation::String
    output::Array{Symbol,1}
end

Arguments

  • operation::String: operation to perform (+, -, *, /)
  • output::Array{Symbol,1}
source
SLiDE.ConcatenateType
mutable struct Concatenate <: Edit
    col::Array{Symbol,1}
    on::Array{Symbol,1}
    var::Symbol
end

Concatenate side-by-side DataFrames into one normal-form DataFrame.

Arguments

  • col::Array{Symbol,1}: final column names
  • on::Array{Symbol,1}: column name indicator specifying where to stack
  • var::Symbol: column name for storing indicator
source
SLiDE.DescribeType
mutable struct Describe <: Edit
    col::Symbol
end

This DataType is required when multiple DataFrames will be appended into one output file (say, if multiple sheets from an XLSX file are included). Before the DataFrames are appended, a column col will be added and filled with the value in the file descriptor. !!!! Does it make sense to have a DataType with one field?

Arguments

  • col::Symbol: name of new column
source
SLiDE.DeselectType
mutable struct Deselect <: Edit
    col::Array{Symbol,1}
    operation::String
end

Arguments

  • col::Array{Symbol,1}: name of column containing data to remove
  • operation::String: how to determine what to drop
source
SLiDE.DropType
mutable struct Drop <: Edit
    col::Symbol
    val::Any
    operation::String
end

Remove information from the dataframe - either an entire column or rows containing specified values.

Arguments

  • col::Symbol: name of column containing data to remove
  • val::Any: value to drop
  • operation::String: how to determine what to drop
source
SLiDE.GroupType
mutable struct Group <: Edit
    file::String
    from::Symbol
    to::Array{Symbol,1}
    input::Symbol
    output::Array{Symbol,1}
end

Use to edit files containing data in successive dataframes with an identifying header cell or row.

Arguments

  • file::String: mapping .csv file name in the coremaps directory. The mapping file should correlate with the header information identifying each data group. It will be used to separate the header rows from data.
  • from::Symbol: name of the mapping column containing input values
  • to::Array{Symbol,1}: name of the mapping column containing output values
  • input::Symbol: name of the input column containing
  • output::Array{Symbol,1}: name of the output column created
source
SLiDE.MapType
mutable struct Map <: Edit
    file::Any
    from::Array{Symbol,1}
    to::Array{Symbol,1}
    input::Array{Symbol,1}
    output::Array{Symbol,1}
    kind::Symbol
end

Define an output column containing values based on those in an input column. The mapping columns from -> to are contained in a .csv file in the coremaps directory. The columns input and from should contain the same values, as should output and to.

Arguments

  • file::Any: mapping .csv file name in the coremaps directory
  • from::Array{Symbol,1}: name of the mapping column containing input values
  • to::Array{Symbol,1}: name of the mapping column containing output values
  • input::Array{Symbol,1}: name of the input column to map
  • output::Array{Symbol,1}: name of the output column created
  • kind::Symbol: type of join to perform.
source
SLiDE.MatchType
mutable struct Match <: Edit
    on::Regex
    input::Symbol
    output::Array{Symbol,1}
end

Extract values from the specified column into a column or columns based on the specified regular expression.

Arguments

  • on::Regex: string indicating where to split
  • input::Symbol: column to split
  • output::Array{Symbol,1}: column names to label text surrounding the split
source
SLiDE.MeltType
mutable struct Melt <: Edit
    on::Array{Symbol,1}
    var::Symbol
    val::Symbol
end

Normalize the dataframe by 'melting' columns into rows, lengthening the dataframe by duplicating values in the column on into new rows and defining 2 new columns: 1. var with header names from the original dataframe. 2. val with column values from the original dataframe. This operation can only be performed once per dataframe.

Arguments

  • on::Array{Symbol,1}: name of column(s) NOT included in melt
  • var::Symbol: name of column containing header NAMES from the original dataframe
  • val::Symbol: name of column containing VALUES from the original dataframe
source
SLiDE.OperateType
mutable struct Operate <: Edit
    operation::String
    from::Array{Symbol,1}
    to::Array{Symbol,1}
    input::Array{Symbol,1}
    output::Symbol
end

Perform an arithmetic operation across multiple DataFrame columns.

Arguments

  • operation::String: operation to perform (+, -, *, /)
  • from::Array{Symbol,1}: name of original comment column (ex. units)
  • to::Array{Symbol,1}: name of new comment column (ex. units)
  • input::Array{Symbol,1}: names of columns on which to operate
  • output::Symbol: name of result column
source
SLiDE.OrderType
mutable struct Order <: Edit
    col::Array{Symbol,1}
    type::Array{DataType,1}
end

Rearranges columns in the order specified by cols and sets them to the specified type.

Arguments

  • col::Array{Symbol,1}: Ordered list of DataFrame columns
  • type::Array{DataType,1}: Ordered column types.
source
SLiDE.OrderedGroupType
mutable struct OrderedGroup <: Edit
    on::Array{Symbol,1}
    var::Symbol
    val::Array{Any,1}
end

maybe, if on and var are the same, we can just fill in groups? i'm thinking SCTG group.

Arguments

  • on::Array{Symbol,1}: name of columns containing information specific to a particular level
  • var::Symbol: name of column containing information of what we will unstack on
  • val::Array{Any,1}: ordered list of values to unstack on. If empty, unstack in order of appearance.
source
SLiDE.RenameType
mutable struct Rename <: Edit
    from::Symbol
    to::Symbol
end

Change column name from -> to.

Arguments

  • from::Symbol: original column name
  • to::Symbol: new column name
source
SLiDE.ReplaceType
mutable struct Replace <: Edit
    col::Symbol
    from::Any
    to::Any
end

Replace values in col from -> to.

Arguments

  • col::Symbol: name of column containing values to be replaced
  • from::Any: value to replace
  • to::Any: new value
source
SLiDE.StackType
mutable struct Stack <: Edit
    on::Array{Symbol,1}
    var::Symbol
    val::Symbol
end

Normalize the dataframe by 'melting' columns into rows, lengthening the dataframe by duplicating values in the column on into new rows and defining 2 new columns: 1. var with header names from the original dataframe. 2. val with column values from the original dataframe. This operation can only be performed once per dataframe.

Arguments

  • on::Array{Symbol,1}: name of column(s) NOT included in melt
  • var::Symbol: name of column containing header NAMES from the original dataframe
  • val::Symbol: name of column containing VALUES from the original dataframe
source

File

SLiDE.CSVInputType
mutable struct CSVInput <: File
    name::String
    descriptor::String
end

Read .csv file

Arguments

  • name::String: input file name
  • descriptor::String: file descriptor
source
SLiDE.DataInputType
mutable struct DataInput <: File
    name::String
    descriptor::String
    col::Array{Symbol,1}
end

Read .csv file with specific column names

Arguments

  • name::String: input file name
  • descriptor::String: file descriptor
  • col::Array{Symbol,1}: data column names
source
SLiDE.GAMSInputType
mutable struct GAMSInput <: File
    name::String
    col::Array{Symbol,1}
end

Read .map or .set file

Arguments

  • name::String: input file name
  • col::Array{Symbol,1}: column names
source
SLiDE.SetInputType
mutable struct SetInput <: File
    name::String
    descriptor::Symbol
end

Read .csv file with specific column names

Arguments

  • name::String: input file name
  • descriptor::Symbol: file descriptor
source
SLiDE.XLSXInputType
mutable struct XLSXInput <: File
    name::String
    sheet::String
    range::String
    descriptor::String
end

Read .xlsx file.

Arguments

  • name::String: input file name
  • sheet::String: input sheet name
  • range::String: input sheet range
  • descriptor::String: file descriptor
source