You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stopf("You have wrapped := with {} which is ok but then := must be the only thing inside {}. You have something else inside {} as well. Consider placing the {} on the RHS of := instead; e.g. DT[,someCol:={tmpVar1<-...;tmpVar2<-...;tmpVar1*tmpVar2}]")
315
+
stopf("Invalid use of `:=` inside `{}`. `:=` must be the only expression inside `{}` when used in `j`. Instead of: DT[{tmp1 <- ...; tmp2 <- ...; someCol := tmp1 * tmp2}], Use: DT[,someCol := {tmp1 <- ...; tmp2 <- ...; tmp1 * tmp2}]")
316
316
}
317
317
}
318
318
if (root=="eval"&&!any(all.vars(jsub[[2L]]) %chin% names_x)) {
# this error is detected when eval'ing isub and replaced with a more helpful one when using := in i due to forgetting a comma, #4227
2887
-
stopf('Check that is.data.table(DT) == TRUE. Otherwise, :=, `:=`(...) and let(...) are defined for use in j, once only and in particular ways. Note that namespace-qualification like data.table::`:=`(...) is not supported. See help(":=").', class="dt_invalid_let_error")
2887
+
stopf('Check that is.data.table(DT) == TRUE. Otherwise, `:=` is defined for use in j, once only and in particular ways. See help(":=", "data.table"). A common reason for this error is allocating a new column in `j` and using `<-` instead of `:=`; e.g., `DT[, new_col <- 1]` should be `DT[, new_col := 1]`. Another is using `:=` in a multi-statement `{...}` block; please use `:=` as the only statement in `j`.', class="dt_invalid_let_error")
Copy file name to clipboardExpand all lines: man/fread.Rd
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,15 @@ Currently, the \code{yaml} setting is somewhat inflexible with respect to incorp
118
118
119
119
When \code{input} begins with http://, https://, ftp://, ftps://, or file://, \code{fread} detects this and \emph{downloads} the target to a temporary file (at \code{tempfile()}) before proceeding to read the file as usual. URLS (ftps:// and https:// as well as ftp:// and http://) paths are downloaded with \code{download.file} and \code{method} set to \code{getOption("download.file.method")}, defaulting to \code{"auto"}; and file:// is downloaded with \code{download.file} with \code{method="internal"}. NB: this implies that for file://, even files found on the current machine will be "downloaded" (i.e., hard-copied) to a temporary file. See \code{\link{download.file}} for more details.
120
120
121
+
\bold{Automatic Decompression:}
122
+
123
+
In many cases, \code{fread} can automatically detect and decompress files with common compression extensions directly, without needing an explicit connection object or shell commands. This works by checking the file extension.
124
+
125
+
\itemize{
126
+
\item \code{.gz} and \code{.bz2} are supported out of the box.
127
+
\item \code{.zip} is also supported. If the archive contains a single data file, \code{fread} will read it. If the archive contains multiple files, \code{fread} will produce an error.
128
+
}
129
+
121
130
\bold{Shell commands:}
122
131
123
132
\code{fread} accepts shell commands for convenience. The input command is run and its output written to a file in \code{tmpdir} (\code{\link{tempdir}()} by default) to which \code{fread} is applied "as normal". The details are platform dependent -- \code{system} is used on UNIX environments, \code{shell} otherwise; see \code{\link[base]{system}}.
\code{fwrite} beganasacommunitycontributionwith \href{https://github.com/Rdatatable/data.table/pull/1613}{pullrequest#1613} by Otto Seiskari. This gave Matt Dowle the impetus to specialize the numeric formatting and to parallelize: \url{https://h2o.ai/blog/2016/fast-csv-writing-for-r/}. Final items were tracked in \href{https://github.com/Rdatatable/data.table/issues/1664}{issue #1664} such as automatic quoting, \code{bit64::integer64} support, decimal/scientific formatting exactly matching \code{write.csv} between 2.225074e-308 and 1.797693e+308 to 15 significant figures, \code{row.names}, dates (between 0000-03-01 and 9999-12-31), times and \code{sep2} for \code{list} columns where each cell can itself be a vector.
SEXPRCHK; // a 2 item list holding vars (result of checkVars) and not_NA_indices. PROTECTed up in fmelt so that preprocess() doesn't need to PROTECT. To pass rchk, #2865
286
-
SEXPidcols,// convenience pointers into RCHK[0][0], RCHK[0][1] and RCHK[1] respectively
287
-
variable_table,// NULL or data for variable column(s).
288
-
valuecols,// list with one element per output/value column, each element is an integer vector.
289
-
not_NA_indices;
290
-
int*isfactor,
291
-
*leach,// length of each element of the valuecols(measure.vars) list.
292
-
*isidentical; // are all inputs for this value column the same type?
293
-
intlids,// number of id columns.
294
-
lvars,// number of variable columns.
295
-
lvalues,// number of value columns.
296
-
lmax,// max length of valuecols elements / number of times to repeat ids.
297
-
totlen,// of output/long DT result of melt operation.
298
-
nrow; // of input/wide DT to be melted.
285
+
SEXPRCHK; // a 2 item list holding vars (result of checkVars) and not_NA_indices. PROTECTed up in fmelt so that preprocess() doesn't need to PROTECT. To pass rchk, #2865
286
+
SEXPidcols; // convenience pointers into RCHK[0][0], RCHK[0][1] and RCHK[1] respectively
287
+
SEXPvariable_table;// NULL or data for variable column(s).
288
+
SEXPvaluecols; // list with one element per output/value column, each element is an integer vector.
289
+
SEXPnot_NA_indices;
290
+
int*isfactor;
291
+
int*leach; // length of each element of the valuecols(measure.vars) list.
292
+
int*isidentical;// are all inputs for this value column the same type?
293
+
intlids; // number of id columns.
294
+
intlvars; // number of variable columns.
295
+
intlvalues; // number of value columns.
296
+
intlmax; // max length of valuecols elements / number of times to repeat ids.
297
+
inttotlen; // of output/long DT result of melt operation.
0 commit comments