Skip to content

long column names go past width #7797

@tdhock

Description

@tdhock

Related to #7788 which implemented this abbreviation:

> options(width=20);data.table(x="abcdefghijklmnopqrstuvwxyz")
                   x
              <char>
1: abcdefghijklmn...

long column names can still go over width:

> options(width=20);data.table(abcdefghijklmnopqrstuvwxyz=1)
   abcdefghijklmnopqrstuvwxyz
                        <num>
1:                          1
> options(width=20, datatable.print.trunc.cols=TRUE);data.table(abcdefghijklmnopqrstuvwxyz=1)
1 variable not shown: [abcdefghijklmnopqrstuvwxyz <num>]

I would expect some output like:

> options(width=20);data.table(abcdefghijklmnopqrstuvwxyz=1)
   abcdefghijklmnop<num>
1:                 1
> options(width=20, datatable.print.trunc.cols=TRUE);data.table(abcdefghijklmnopqrstuvwxyz=1)
1 variable not shown:
abcdefghijklm<num>

in comparison, others go over width too

> options(width=20);data.frame(x="abcdefghijklmnopqrstuvwxyz")
                           x
1 abcdefghijklmnopqrstuvwxyz
> options(width=20);data.frame(abcdefghijklmnopqrstuvwxyz=1)
  abcdefghijklmnopqrstuvwxyz
1                          1
> options(width=20);tibble::tibble(abcdefghijklmnopqrstuvwxyz=1)
# A tibble: 1 × 1
# ℹ 1 more
#   variable:
#   abcdefghijklmnopqrstuvwxyz <dbl>
> options(width=80);tibble::tibble(abcdefghijklmnopqrstuvwxyz=1)
# A tibble: 1 × 1
  abcdefghijklmnopqrstuvwxyz
                       <dbl>
1                          1
> 

this is not high priority because long column names are not frequent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions