I don't believe this is to be expected. A bug report should be filed (it is present in 1.8.10 on CRAN as well)
.SD is locked so you can't "mess" with it within a call to `[.data.table`, but this "locked" status should not be retained following the completion of that call ________________________________________ From: [email protected] [[email protected]] on behalf of G See [[email protected]] Sent: Monday, 18 November 2013 9:32 AM To: [email protected] Subject: [datatable-help] .SD is locked 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 _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help _______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
