Function to convert data.table to fixed width:

fixedWidthTable(
  x,
  columnSeparator = " ",
  lineSeparator = NULL,
  na = "-",
  enable.auto_unbox = TRUE,
  add.line.index = FALSE,
  line.index.start = 1
)

Arguments

x

The table to modify.

columnSeparator

The string to separate columns by, defaulted to a single space.

lineSeparator

The string to separate lines by, defaulted to a NULL, which keeps the output as a vector of strings.

na

The string to replace NAs by, defaulted to "-".

enable.auto_unbox

Logical: If TRUE wrap the output in a list if pretty is TRUE and the output is of length 1. This keeps the array when converting to JSON also for length 1.

add.line.index

Logical: If TRUE (the default) print row indices as in data.table.

line.index.start

The start of the line indices.