Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:= not suppressing print in R 3.2.0 #1122

Closed
jangorecki opened this issue Apr 19, 2015 · 11 comments
Closed

:= not suppressing print in R 3.2.0 #1122

jangorecki opened this issue Apr 19, 2015 · 11 comments
Labels
Milestone

Comments

@jangorecki
Copy link
Member

Worth to note that test.data.table passed successfully.

library(data.table)
# data.table 1.9.5  For help type: ?data.table
# *** NB: by=.EACHI is now explicit. See README to restore previous behaviour.
DT <- data.table(a=1L)
DT[, a:=2L]
#    a
#1: 2
sessionInfo()
# R version 3.2.0 (2015-04-16)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Ubuntu 14.04.2 LTS
# 
# locale:
#  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#  [3] LC_TIME=en_DK.UTF-8        LC_COLLATE=en_US.UTF-8    
#  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C             
#  [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.9.5
# 
# loaded via a namespace (and not attached):
# [1] chron_2.3-45
@jangorecki jangorecki changed the title := do not suppress print in R 3.2.0 := not suppressing print in R 3.2.0 Apr 19, 2015
@shrektan
Copy link
Member

I encounter the same problem .
Here is my sessioninfo:

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

@jangorecki
Copy link
Member Author

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 where i = ! suppress output:

dt[ any stuff ][!]

@shrektan
Copy link
Member

@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.

@arunsrinivasan
Copy link
Member

@shrektan, thank you :-). On this issue, I think @mattdowle would've much better idea.

@abielr
Copy link

abielr commented May 9, 2015

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.

@abielr
Copy link

abielr commented May 9, 2015

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.

@arunsrinivasan arunsrinivasan added this to the v1.9.6 milestone May 9, 2015
@arunsrinivasan
Copy link
Member

@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.

@MichaelChirico
Copy link
Member

:= 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 1

Relevant 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?

@MaxGhenis
Copy link

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.

@arunsrinivasan
Copy link
Member

Update to R 3.2.2 and try again.

@MichaelChirico
Copy link
Member

@arunsrinivasan not printing out anymore, thanks for the tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants