Repository navigation
:= not suppressing print in R 3.2.0 #1122
Description
Activity
- changed the title
[-]`:=` do not suppress print in R 3.2.0[/-][+]`:=` not suppressing print in R 3.2.0[/+]on Apr 19, 2015 I encounter the same problem .
Here is mysessioninfo:R version 3.2.0 (2015-04-16) Platform: i386-w64-mingw32/i386 (32-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936 [2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936 [3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936 [4] LC_NUMERIC=C [5] LC_TIME=Chinese (Simplified)_People's Republic of China.936 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] data.table_1.9.5 loaded via a namespace (and not attached): [1] tools_3.2.0 chron_2.3-45
I found this not a big deal as data.table print nicely. If the current suppress print is costly in maintenance maybe it should be dropped at all?
Maybe a special[call to explicitly make results invisibility would be less costly in terms of dev and maintenance?
Example wherei = !suppress output:dt[ any stuff ][!]
@arunsrinivasan
I use data.table a lot in my work~ This package is really really good and I love it so much.
It would be better, if this can be solved, so I can stop to write things like `invisible(DT[, x:=1])'.
Anything I can do to help?
Thanks.@shrektan, thank you :-). On this issue, I think @mattdowle would've much better idea.
On a related point, the programmers of the IRKernel package for Jupyter are having trouble determining if
:=should suppress output. See https://github.com/IRkernel/IRkernel/issues/127. Note that this is with R < 3.2.0.Changing
typeof(last(SYS)[[2L]]) %chin% c("list","promise"))to
typeof(last(SYS)[[2L]]) %chin% c("list","promise","symbol"))in the
R/data.table.R/print.data.table()function seems to fix the issue (tested on R 3.2.0 on OSX), however I'm really not sure what is going on with these calls so I don't have a good sense of whether this would also cause unintended behavior elsewhere.@abielr thanks for a possible solution. Have added to 1.9.6. I think it'd be nice to have this fixed for next release.
:=within a function is back to printing out for me, e.g.:dt<-data.table(a=c(1,2,3)) f<-function(nm){dt[,(nm):=1]} > f("b") a b 1: 1 1 2: 2 1 3: 3 1Relevant
sessionInfo()bits:R version 3.2.1 (2015-06-18) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 14.04.2 LTS ... data.table_1.9.5 #(updated this morning)Was there another update I'm missing?
I believe
:=printing within a function is a separate issue, which has existed in the past. Would be great to fix that as well, but may make sense to file separately.Update to R 3.2.2 and try again.
@arunsrinivasan not printing out anymore, thanks for the tip.
Worth to note that
test.data.tablepassed successfully.