The function removes duplicated columns, orders the columns as per the order defined by getDataTypeDefinition, optionally removed undefined columns, orders the rows, and finally deletes any data.table keys from the output tables. The input is modified by reference using data.table.

formatOutput(
  data,
  dataType,
  keep.all = TRUE,
  allow.missing = FALSE,
  primaryColumnOrder = NULL,
  secondaryColumnOrder = NULL,
  secondaryRowOrder = NULL,
  removeStoXKeys = FALSE,
  orderColumns = TRUE,
  orderRows = TRUE
)

Arguments

data

A table or list of tables to return from the StoX function.

dataType

The data type to format against.

keep.all

Logical: If TRUE keep all columns, and if FALSE delete undefined columns.

allow.missing

Logical: If TRUE allow for unrelevant column names defined in secondaryColumnOrder.

primaryColumnOrder

Character: A vector of names of columns that should be placed first regardless of the definition of columns specified in the dataTypeDefinition.

secondaryColumnOrder, secondaryRowOrder

A vector of column names specifying order of column not defined by getDataTypeDefinition used to prioritize when ordering columns and rows, respectively.

removeStoXKeys

Logical: If TRUE remove the key columns, which are those ending with "Key".

orderColumns

Logical: If TRUE (the default) order the columns by the first the primaryColumnOrder, then the variables defined for the StoX datatype (as returned by getDataTypeDefinition), then by the secondaryColumnOrder

orderRows

Logical: If TRUE (the default) order the rows first by the values in the variables defined for the StoX datatype (as returned by getDataTypeDefinition), then by the values of the variables specified by secondaryRowOrder.