1+ \name {data.table - options }
2+ \alias {data.table - options }
3+ \alias {data.table.options }
4+
5+ \title {Global Options for the data.table Package }
6+
7+ \description {
8+ The data.table package uses a number of global options to control its
9+ behavior. These are regular R options that can be set with options()
10+ and retrieved with getOption().
11+
12+ This page provides a comprehensive , up - to - date list of all user - configurable
13+ options.
14+ }
15+
16+ \usage {
17+ \preformatted {
18+ # Get the current value of an option
19+ getOption(" datatable.print.topn" )
20+
21+ # Set a new value for an option
22+ options(datatable.print.topn = 10 )
23+ }
24+ }
25+
26+ \section {Printing Options }{
27+ \details {
28+ \describe {
29+ \item {\code {datatable.print.topn }}{An integer. When a data.table is printed ,
30+ only the first topn and last topn rows are displayed. This prevents
31+ cluttering the console for large tables.
32+ Default : \code {5L }. See \code {\link {print.data.table }}. }
33+ \item {\code {datatable.print.nrows }}{An integer. The total number of rows
34+ to print before the topn logic is triggered.
35+ Default : \code {100L }. }
36+ \item {\code {datatable.print.class }}{A logical. If \code {TRUE }, the class of
37+ each column is printed below the column name.
38+ Default : \code {FALSE }. }
39+ \item {\code {datatable.print.keys }}{A logical. If \code {TRUE }, the table ' s
40+ keys are printed above the data.
41+ Default: \c ode{FALSE}.}
42+ \i tem{\c ode{datatable.print.trunc.cols}}{A logical. If \c ode{TRUE} and a
43+ table has more columns than fit on the screen, it truncates the middle
44+ columns for printing (e.g., a, b, ..., z). If \c ode{FALSE}, it wraps
45+ the columns to the next line.
46+ Default: \c ode{FALSE}.}
47+ \i tem{\c ode{datatable.prettyprint.char}}{An integer. The maximum number of
48+ characters to display in a character column cell before truncating
49+ with ....
50+ Default: \c ode{100L}.}
51+ }
52+ }
53+
54+ \s ection{File I/O Options (fread and fwrite)}{
55+ \d escribe{
56+ \i tem{\c ode{datatable.fread.input.cmd.message}}{A logical. If \c ode{TRUE},
57+ fread will print the shell command it is using when the input is a
58+ command (e.g., fread("grep ...")).
59+ Default: \c ode{TRUE}. See \c ode{\l ink{fread}}.}
60+ \i tem{\c ode{datatable.fread.datatable}}{A logical. If \c ode{TRUE}, fread
61+ returns a data.table. If FALSE, it returns a data.frame.
62+ Default: \c ode{TRUE}.}
63+ \i tem{\c ode{datatable.integer64}}{A character string. Controls how fread
64+ handles 64-bit integers. Can be "integer64" (requires bit64 package),
65+ "double" (loses precision), or "character" (reads as text).
66+ Default: \c ode{"integer64"}.}
67+ \i tem{\c ode{datatable.logical01}}{A logical. If \c ode{TRUE}, fread will
68+ interpret columns containing only 0 and 1 as logical FALSE/TRUE.
69+ Default: \c ode{FALSE}.}
70+ \i tem{\c ode{datatable.showProgress}}{An integer or logical. Controls whether
71+ long-running operations like fread display a progress bar. Default
72+ is \c ode{interactive()}, showing it only in interactive R sessions.}
73+ }
74+ }
75+
76+ \s ection{Join and Subset Options}{
77+ \d escribe{
78+ \i tem{\c ode{datatable.allow.cartesian}}{A logical. A safety feature to prevent
79+ accidental memory-exploding joins. If FALSE (default), a join is not
80+ allowed if the result would be more rows than max(nrow(x), nrow(i)),
81+ which occurs when a row in i matches more than one row in x.
82+ Default: \c ode{FALSE}. See \c ode{\l ink{data.table}}.}
83+ \i tem{\c ode{datatable.nomatch}}{Controls the behavior of non-matching rows in
84+ a join. The default is NA, which returns NA for columns of x when a
85+ row in i has no match. Can be set to 0L to drop non-matching rows,
86+ behaving like an inner join.
87+ Default: \c ode{NA}.}
88+ }
89+ }
90+
91+ \s ection{Performance and Indexing Options}{
92+ \d escribe{
93+ \i tem{\c ode{datatable.auto.index}}{A logical. If \c ode{TRUE}, data.table
94+ automatically creates a secondary index on-the-fly the first time a column
95+ is used in a query (e.g., DT[col == ' value ' ]). This dramatically
96+ speeds up all subsequent queries on that same column.
97+ Default: \c ode{TRUE}.}
98+ \i tem{\c ode{datatable.use.index}}{A logical. A global switch to control
99+ whether existing indices are used for subsetting.
100+ Default: \c ode{TRUE}.}
101+ \i tem{\c ode{datatable.optimize}}{An integer controlling the GForce query
102+ optimization engine. Set to Inf to enable all possible optimizations,
103+ which data.table does by default. See \c ode{\l ink{datatable.optimize}}.
104+ Default: \c ode{Inf}.}
105+ \i tem{\c ode{datatable.alloccol}}{An integer. data.table pre-allocates
106+ memory for a certain number of columns when first created. This option
107+ controls the length of this pre-allocation, improving performance when
108+ adding many columns via :=. See \c ode{\l ink{alloc.col}}.
109+ Default: \c ode{1024L}.}
110+ }
111+ }
112+
113+ \s ection{Development and Verbosity Options}{
114+ \d escribe{
115+ \i tem{\c ode{datatable.verbose}}{A logical. If \c ode{TRUE}, data.table will
116+ print detailed, step-by-step diagnostic information as it processes a
117+ query. Extremely useful for debugging and performance tuning.
118+ Default: \c ode{FALSE}.}
119+ \i tem{\c ode{datatable.pedantic}}{A logical. If \c ode{TRUE}, data.table
120+ enters a "pedantic" mode, issuing helpful warnings for situations that
121+ are not technically errors but might be unintentional (e.g., when a
122+ variable in j is found in the global environment instead of inside the
123+ data.table).
124+ Default: \c ode{FALSE}.}
125+ \i tem{\c ode{datatable.dfdispatchwarn}}{A logical. If \c ode{TRUE}, warns
126+ when a generic function from another package (e.g., dplyr::filter) is
127+ applied to a data.table. This can be a useful reminder that you are not
128+ using data.table' s optimized methods.
129+ Default : \code {TRUE }. }
130+ }
131+ }
132+
133+ \section {Internal Strings (Not User Options )}{
134+ \describe {
135+ \item {The following strings are not options to be set by users. }{They are
136+ included here to assist developers searching the source code. They are typically
137+ parts of URLs found in code comments or documentation.
138+ \itemize {
139+ \item \code {datatable.com }
140+ \item \code {datatable.github.io }
141+ \item \code {datatable.gitlab.io }
142+ }
143+ }
144+ }
145+ }
146+ }
147+
148+ \seealso {
149+ \code {\link {options }},
150+ \code {\link {getOption }},
151+ \code {\link {data.table }}
152+ }
153+
154+ \keyword {data }
155+ \keyword {utilities }
0 commit comments