The data.table package uses a number of global options to control its behavior. These are regular R options that can be set with options() and retrieved with getOption(). For example:
# Get the current value of an option
getOption("datatable.print.topn") # Set a new value for an option
options(datatable.print.topn = 10)
This page provides a comprehensive, up-to-date list of all user-configurable options. NB: If you're reading this on the web, make sure the version numbers match with what you have installed.
See print.data.table for a full description of printing data.tables.
datatable.print.topnAn integer, default 5L. When a data.table is printed,
only the first topn and last topn rows are displayed.
datatable.print.nrowsAn integer, default 100L. The total number of rows
to print before the topn logic is triggered.
datatable.print.classA logical, default FALSE. If TRUE, the class of
each column is printed below its name.
datatable.print.keysA logical, default FALSE. If TRUE, the table's
keys are printed above the data.
datatable.show.indicesA logical, default TRUE. A synonym for datatable.print.keys for historical reasons.
datatable.print.trunc.colsA logical, default FALSE. If TRUE and a
table has more columns than fit on the screen, it truncates the middle columns.
datatable.prettyprint.charAn integer, default 100L. The maximum number of
characters to display in a character column cell before truncating.
datatable.print.colnamesA logical, default TRUE. If TRUE, prints column names.
datatable.print.rownamesA logical, default TRUE. If TRUE, prints row numbers.
See fread and fwrite for a full description of data.table I/O.
datatable.fread.input.cmd.messageA logical, default TRUE. If TRUE,
fread will print the shell command it is using when the input is a
command (e.g., fread("grep ...")).
datatable.fread.datatableA logical, default TRUE. If TRUE, fread
returns a data.table. If FALSE, it returns a data.frame.
datatable.integer64A character string, default "integer64". Controls how fread
handles 64-bit integers. Can be "integer64", "double", or "character".
datatable.logical01A logical, default FALSE. If TRUE, fread will
interpret columns containing only 0 and 1 as logical.
datatable.keepLeadingZerosA logical, default FALSE. If TRUE, fread
preserves leading zeros in character columns by reading them as strings;
otherwise they may be coerced to numeric.
datatable.logicalYNA logical, default FALSE. If TRUE, fread
will interpret "Y" and "N" as logical.
datatable.na.stringsA character vector, default "NA". Global default for strings that
fread should interpret as NA.
datatable.fwrite.sepA character string, default ",". The default separator
used by fwrite.
datatable.showProgressAn integer or logical, default interactive(). Controls whether
long-running operations like fread display a progress bar.
datatable.allow.cartesianA logical, default FALSE. Controls the default value of the
allow.cartesian parameter; see data.table. If the value of this parameter is FALSE, an error is raised as a safeguard against an explosive Cartesian join.
datatable.join.manyA logical. Stub description to be embellished later in PR #4370.
datatable.auto.indexA logical, default TRUE. If TRUE, data.table
automatically creates a secondary index on-the-fly when a column is first
used in a subset, speeding up all subsequent queries.
datatable.use.indexA logical, default TRUE. A global switch to control
whether existing secondary indices are used for subsetting.
datatable.forder.auto.indexA logical, default TRUE. Similar to datatable.auto.index,
but applies to ordering operations (forder).
datatable.optimizeA numeric, default Inf. Controls the GForce query
optimization engine. The default enables all possible optimizations.
See datatable.optimize.
datatable.alloccolAn integer, default 1024L. Controls the number of column
slots to pre-allocate, improving performance when adding many columns.
See alloc.col.
datatable.reuse.sortingA logical, default TRUE. If TRUE, data.table
can reuse the sorted order of a table in joins, improving performance.
datatable.quietA logical, default FALSE. The master switch to suppress all
data.table status messages, including the startup message.
datatable.verboseA logical, default FALSE. If TRUE, data.table will
print detailed diagnostic information as it processes a query.
datatable.enlistExperimental feature. Default is NULL. If set to a function
(e.g., list), the j expression can return a list, which will then
be "enlisted" into columns in the result.
datatable.old.matrix.autonameLogical, default TRUE. Governs how the output of
expressions like data.table(x=1, cbind(1)) will be named. When TRUE, it will be named
V1, otherwise it will be named V2.