[datatable-help] .SD is locked

G See gsee000 at gmail.com
Sun Nov 17 23:32:24 CET 2013


Hi,

Is the following error expected?

> library(data.table)
data.table 1.8.11  For help type: help("data.table")
> x <- as.data.table(BOD)
> xx <- x[, .SD, .SDcols="Time"]
> xx[, Time:=as.numeric(Time)]
Error in `[.data.table`(xx, , `:=`(Time, as.numeric(Time))) :
  .SD is locked. Using := in .SD's j is reserved for possible future
use; a tortuously flexible way to modify by group. Use := in j
directly to modify by group by reference.
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] data.table_1.8.11

loaded via a namespace (and not attached):
[1] plyr_1.8       reshape2_1.2.2 stringr_0.6.2


Thanks,
Garrett


More information about the datatable-help mailing list