Skip to content

print.trunc.cols shows nothing if first column is too long #7717

@tdhock

Description

@tdhock

related to #7716

> options(datatable.print.trunc.cols=TRUE)
> options(width=10)
> data.table(x="1234567", y=1, z=2, a=3)
4 variables not shown: [x, y, z, a]
> data.table(y=1, z=2, a=3, x="1234567")
   y z a
1: 1 2 3
1 variable not shown: [x]

we see that the first table has 4 variables not shown, whereas the second has only 1.
the tables have the same contents but different column order.
we could imagine improving the print method so that it only hides x (and prints the others) in both cases.

for reference ?print.data.table says

trunc.cols: If ‘TRUE’, only the columns that can be printed in the
          console without wrapping the columns to new lines will be
          printed (similar to ‘tibbles’).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions