Skip to content

print should abbreviate columns larger than options(width)? #7718

@tdhock

Description

@tdhock

Below I ask for width=10 but that is only respected for the first three numeric columns.

> options(width=10, datatable.prettyprint.char=NULL, datatable.print.trunc.cols=FALSE, datatable.print.class=FALSE)
> data.table(V1=1, V2=2, V3=3, x="12345678901234567890", L=list(1:9))
   V1 V2
1:  1  2
   V3
1:  3
                      x
1: 12345678901234567890
                    L
1: 1,2,3,4,5,6,...[9]

both x and L are wider than options(width=10), which seems to violate the definition in ?options:

     ‘width’:
          controls the maximum number of columns on a line used in
          printing vectors, matrices and arrays, and when filling by
          cat.

I would ask to change the output to:

   V1 V2
1:  1  2
   V3
1:  3
         x
1: 123456L
1: 1,2,3,…

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions