Skip to content

:= not suppressing print in R 3.2.0 #1122

Description

@jangorecki

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

Activity

  1. changed the title [-]`:=` do not suppress print in R 3.2.0[/-] [+]`:=` not suppressing print in R 3.2.0[/+] on Apr 19, 2015
  2. shrektan commented on Apr 21, 2015

    @shrektan
    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
  3. jangorecki commented on Apr 21, 2015

    @jangorecki
    MemberAuthor

    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 ][!]
  4. shrektan commented on Apr 29, 2015

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

  5. arunsrinivasan commented on Apr 29, 2015

    @arunsrinivasan
    Member

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

  6. abielr commented on May 9, 2015

    @abielr

    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.

  7. abielr commented on May 9, 2015

    @abielr

    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.

  8. added this to the v1.9.6 milestone on May 9, 2015
  9. arunsrinivasan commented on May 9, 2015

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

  10. MichaelChirico commented on Jul 18, 2015

    @MichaelChirico
    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?

  11. MaxGhenis commented on Sep 4, 2015

    @MaxGhenis

    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.

  12. arunsrinivasan commented on Sep 4, 2015

    @arunsrinivasan
    Member

    Update to R 3.2.2 and try again.

  13. MichaelChirico commented on Sep 6, 2015

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions