Global Options for the data.table Package
data.table-options.RdThe 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.
Printing Options
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. IfTRUE, the class of each column is printed below its name.datatable.print.keysA logical, default
FALSE. IfTRUE, the table's keys are printed above the data.datatable.show.indicesA logical, default
TRUE. A synonym fordatatable.print.keysfor historical reasons.datatable.print.trunc.colsA logical, default
FALSE. IfTRUEand 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. IfTRUE, prints column names.datatable.print.rownamesA logical, default
TRUE. IfTRUE, prints row numbers.
File I/O Options (fread and fwrite)
See fread and fwrite for a full description of data.table I/O.
datatable.fread.input.cmd.messageA logical, default
TRUE. IfTRUE,freadwill print the shell command it is using when the input is a command (e.g.,fread("grep ...")).datatable.fread.datatableA logical, default
TRUE. IfTRUE,freadreturns adata.table. IfFALSE, it returns adata.frame.datatable.integer64A character string, default
"integer64". Controls howfreadhandles 64-bit integers. Can be "integer64", "double", or "character".datatable.logical01A logical, default
FALSE. IfTRUE,freadwill interpret columns containing only 0 and 1 as logical.datatable.keepLeadingZerosA logical, default
FALSE. IfTRUE,freadpreserves leading zeros in character columns by reading them as strings; otherwise they may be coerced to numeric.datatable.logicalYNA logical, default
FALSE. IfTRUE,freadwill interpret "Y" and "N" as logical.datatable.na.stringsA character vector, default
"NA". Global default for strings thatfreadshould interpret asNA.datatable.fwrite.sepA character string, default
",". The default separator used byfwrite.datatable.showProgressAn integer or logical, default
interactive(). Controls whether long-running operations likefreaddisplay a progress bar.
Join and Subset Options
datatable.allow.cartesianA logical, default
FALSE. Controls the default value of theallow.cartesianparameter; seedata.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.
Performance and Indexing Options
datatable.auto.indexA logical, default
TRUE. IfTRUE,data.tableautomatically 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 todatatable.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. Seedatatable.optimize.datatable.alloccolAn integer, default
1024L. Controls the number of column slots to pre-allocate, improving performance when adding many columns. Seealloc.col.datatable.reuse.sortingA logical, default
TRUE. IfTRUE,data.tablecan reuse the sorted order of a table in joins, improving performance.
Development and Verbosity Options
datatable.quietA logical, default
FALSE. The master switch to suppress alldata.tablestatus messages, including the startup message.datatable.verboseA logical, default
FALSE. IfTRUE,data.tablewill print detailed diagnostic information as it processes a query.datatable.enlistExperimental feature. Default is
NULL. If set to a function (e.g.,list), thejexpression can return alist, which will then be "enlisted" into columns in the result.
Back-compatibility Options
datatable.old.matrix.autonameLogical, default
TRUE. Governs how the output of expressions likedata.table(x=1, cbind(1))will be named. WhenTRUE, it will be namedV1, otherwise it will be namedV2.