| data.table-options {data.table} | R Documentation |
Global Options for the data.table Package
Description
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.
Printing Options
See print.data.table for a full description of printing data.tables.
datatable.print.topn-
An integer, default
5L. When a data.table is printed, only the first topn and last topn rows are displayed. datatable.print.nrows-
An integer, default
100L. The total number of rows to print before the topn logic is triggered. datatable.print.class-
A logical, default
FALSE. IfTRUE, the class of each column is printed below its name. datatable.print.keys-
A logical, default
FALSE. IfTRUE, the table's keys are printed above the data. datatable.show.indices-
A logical, default
TRUE. A synonym fordatatable.print.keysfor historical reasons. datatable.print.trunc.cols-
A logical, default
FALSE. IfTRUEand a table has more columns than fit on the screen, it truncates the middle columns. datatable.prettyprint.char-
An integer, default
100L. The maximum number of characters to display in a character column cell before truncating. datatable.print.colnames-
A logical, default
TRUE. IfTRUE, prints column names. datatable.print.rownames-
A 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.message-
A logical, default
TRUE. IfTRUE,freadwill print the shell command it is using when the input is a command (e.g.,fread("grep ...")). datatable.fread.datatable-
A logical, default
TRUE. IfTRUE,freadreturns adata.table. IfFALSE, it returns adata.frame. datatable.integer64-
A character string, default
"integer64". Controls howfreadhandles 64-bit integers. Can be "integer64", "double", or "character". datatable.logical01-
A logical, default
FALSE. IfTRUE,freadwill interpret columns containing only 0 and 1 as logical. datatable.keepLeadingZeros-
A logical, default
FALSE. IfTRUE,freadpreserves leading zeros in character columns by reading them as strings; otherwise they may be coerced to numeric. datatable.logicalYN-
A logical, default
FALSE. IfTRUE,freadwill interpret "Y" and "N" as logical. datatable.na.strings-
A character vector, default
"NA". Global default for strings thatfreadshould interpret asNA. datatable.fwrite.sep-
A character string, default
",". The default separator used byfwrite. datatable.showProgress-
An integer or logical, default
interactive(). Controls whether long-running operations likefreaddisplay a progress bar.
Join and Subset Options
datatable.allow.cartesian-
A 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.many-
A logical. Stub description to be embellished later in PR #4370.
Performance and Indexing Options
datatable.auto.index-
A 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.index-
A logical, default
TRUE. A global switch to control whether existing secondary indices are used for subsetting. datatable.forder.auto.index-
A logical, default
TRUE. Similar todatatable.auto.index, but applies to ordering operations (forder). datatable.optimize-
A numeric, default
Inf. Controls the GForce query optimization engine. The default enables all possible optimizations. Seedatatable.optimize. datatable.alloccol-
An integer, default
1024L. Controls the number of column slots to pre-allocate, improving performance when adding many columns. Seealloc.col. datatable.reuse.sorting-
A logical, default
TRUE. IfTRUE,data.tablecan reuse the sorted order of a table in joins, improving performance.
Development and Verbosity Options
datatable.quiet-
A logical, default
FALSE. The master switch to suppress alldata.tablestatus messages, including the startup message. datatable.verbose-
A logical, default
FALSE. IfTRUE,data.tablewill print detailed diagnostic information as it processes a query. datatable.enlist-
Experimental 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.autoname-
Logical, default
FALSE. 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.
See Also
options,
getOption,
data.table