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")
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