Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option tibble.width not working #369

Closed
EdwardJRoss opened this issue Jan 17, 2018 · 2 comments
Closed

Option tibble.width not working #369

EdwardJRoss opened this issue Jan 17, 2018 · 2 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@EdwardJRoss
Copy link

The tibble.width option doesn't seem to affect the width of the tibble being printed.

As a user I set tibble.width to Inf to view very long data frames (scrolling horizontally in my window).
A partial workaround is to set width to 10000, but this has other implications.

Example:

options(tibble.width=Inf, width=40)
tibble::as_tibble(iris)
#># A tibble: 150 x 5
#>   Sepal.Length Sepal.Width
#>          <dbl>       <dbl>
#> 1         5.10        3.50
#> 2         4.90        3.00
#> 3         4.70        3.20
#> 4         4.60        3.10
#> 5         5.00        3.60
#> 6         5.40        3.90
#> 7         4.60        3.40
#> 8         5.00        3.40
#> 9         4.40        2.90
#>10         4.90        3.10
#># ... with 140 more rows, and 3 more
#>#   variables: Petal.Length <dbl>,
#>#   Petal.Width <dbl>, Species <fct>

Expected output:
As per the documentation all columns should be printed

options(tibble.width = Inf) will always print all columns, regardless of the width of the screen.

This is the behaviour in tibble 1.3.4

options(tibble.width=Inf, width=40)
tibble::as_tibble(iris)
#># A tibble: 150 x 5
#>   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#>          <dbl>       <dbl>        <dbl>       <dbl>  <fctr>
#> 1          5.1         3.5          1.4         0.2  setosa
#> 2          4.9         3.0          1.4         0.2  setosa
#> 3          4.7         3.2          1.3         0.2  setosa
#> 4          4.6         3.1          1.5         0.2  setosa
#> 5          5.0         3.6          1.4         0.2  setosa
#> 6          5.4         3.9          1.7         0.4  setosa
#> 7          4.6         3.4          1.4         0.3  setosa
#> 8          5.0         3.4          1.5         0.2  setosa
#> 9          4.4         2.9          1.4         0.2  setosa
#>10          4.9         3.1          1.5         0.1  setosa
#># ... with 140 more rows
@krlmlr
Copy link
Member

krlmlr commented Jan 18, 2018

Thanks for raising this. Note that tibble.width = Inf will still output all columns but use at most getOption("width") characters, using a second, third, ... tier of columns if necessary.

@krlmlr krlmlr added the bug an unexpected problem or unintended behavior label Jan 18, 2018
@krlmlr krlmlr closed this as completed in deb6bd1 Jan 20, 2018
krlmlr added a commit that referenced this issue Jan 20, 2018
- `enframe(NULL)` now returns the same as `enframe(logical())` (#352).
- `tbl[1, , drop = TRUE]` now behaves identically to data frames (#367).
- The `tibble.width` option is honored again (#369).
- Faster printing of very wide tibbles (#360).
- Update vignette to match changes in 1.4.1 (#368, @bgreenwell).
- Don't rely on `ncol()` for `glimpse()`, only query `nrow()` and `head()`.
- Return input for zero-column data frames.
- Add test for `glimpse()` with unknown rows (#366, @kevinykuo).
- Faster construction and subsetting for tibbles (#353).
- `tribble()` now ignores trailing commas (#342, @LaDilettante).
- Fix error message when accessing columns using a logical index vector (#337, @mundl).
krlmlr added a commit that referenced this issue Jan 23, 2018
Bug fixes
---------

- Fix OS X builds.
- The `tibble.width` option is honored again (#369).
- `tbl[1, , drop = TRUE]` now behaves identically to data frames (#367).
- Fix error message when accessing columns using a logical index vector (#337, @mundl).
- `glimpse()` returns its input for zero-column data frames.

Features
--------

- `enframe(NULL)` now returns the same as `enframe(logical())` (#352).
- `tribble()` now ignores trailing commas (#342, @LaDilettante).
- Updated vignettes and website documentation.

Performance
-----------

- Faster printing of very wide tibbles (#360).
- Faster construction and subsetting for tibbles (#353).
- Only call `nrow()` and `head()` in `glimpse()`, not `ncol()`.
@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants