@eantonya could you provide an example usage with
The problem here is very much related to
:=, as explained in FAQ 2.22.
The best we can do is to return invisibly _iff_
fn() returns a
data.table. Else, we'll have to modify _all_ the print methods the same way how
print.data.table does cleverly using
I've added the label 'won't fix' for now. As it's a problem with the way base R forces visibility on
[. If you agree, we can close this as such (unless there's an alternative we can come up with).
Tagging @mattdowle as well.
I think this may be identical to #1471. Just found this.
It's too bad R doesn't return something with an
"invisible" attribute when it is the result of
invisible. That would make this easy.
Linking back to http://stackoverflow.com/a/36093766/403310 which links here. We could revisit FAQ 2.18 (the solution there didn't work for me when I just tested it) as well as 2.22 and over a year has passed since we last looked so another attempt may be due.
Hmm. Just noticed that
with(dt, fn()) _doesn't_ print the output. I guess this is related to the whole
.global$print issue more than anything, then.
Can't the same global print suppression that works with
:= work here?
as per Arun comment, we cannot do much about R's
[ forcing visibility, solution is to wrap your data.table expression into