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

Note "Use colnames() to see all variable names" prints unneccesarily #1488

Closed
msberends opened this issue Dec 1, 2022 · 1 comment · Fixed by r-lib/pillar#622
Closed
Labels
bug an unexpected problem or unintended behavior

Comments

@msberends
Copy link

To print tibbles to our liking, we've set in our "department's .Rprofile":

options(pillar.max_footer_lines = Inf)
options(pillar.max_extra_cols = Inf)

Still, the text Use colnames() to see all variable names still always prints, while already all column names can be seen:

dplyr::starwars |> tidyr::pivot_wider(names_from = name, values_from = height)
# A tibble: 86 × 99
    mass hair_color    skin_color  eye_color birth_year sex    gender    homeworld species films  vehicles  starships `Luke Skywalker` `C-3PO` `R2-D2`
   <dbl> <chr>         <chr>       <chr>          <dbl> <chr>  <chr>     <chr>     <chr>   <list> <list>    <list>               <int>   <int>   <int>
 1    77 blond         fair        blue            19   male   masculine Tatooine  Human   <chr>  <chr [2]> <chr [2]>              172      NA      NA
 2    75 NA            gold        yellow         112   none   masculine Tatooine  Droid   <chr>  <chr [0]> <chr [0]>               NA     167      NA
 3    32 NA            white, blue red             33   none   masculine Naboo     Droid   <chr>  <chr [0]> <chr [0]>               NA      NA      96
 4   136 none          white       yellow          41.9 male   masculine Tatooine  Human   <chr>  <chr [0]> <chr [1]>               NA      NA      NA
 5    49 brown         light       brown           19   female feminine  Alderaan  Human   <chr>  <chr [1]> <chr [0]>               NA      NA      NA
 6   120 brown, grey   light       blue            52   male   masculine Tatooine  Human   <chr>  <chr [0]> <chr [0]>               NA      NA      NA
 7    75 brown         light       blue            47   female feminine  Tatooine  Human   <chr>  <chr [0]> <chr [0]>               NA      NA      NA
 8    32 NA            white, red  red             NA   none   masculine Tatooine  Droid   <chr>  <chr [0]> <chr [0]>               NA      NA      NA
 9    84 black         light       brown           24   male   masculine Tatooine  Human   <chr>  <chr [0]> <chr [1]>               NA      NA      NA
10    77 auburn, white fair        blue-gray       57   male   masculine Stewjon   Human   <chr>  <chr [1]> <chr [5]>               NA      NA      NA
# … with 76 more rows, and 84 more variables: `Darth Vader` <int>, `Leia Organa` <int>, `Owen Lars` <int>, `Beru Whitesun lars` <int>, `R5-D4` <int>,
#   `Biggs Darklighter` <int>, `Obi-Wan Kenobi` <int>, `Anakin Skywalker` <int>, `Wilhuff Tarkin` <int>, Chewbacca <int>, `Han Solo` <int>,
#   Greedo <int>, `Jabba Desilijic Tiure` <int>, `Wedge Antilles` <int>, `Jek Tono Porkins` <int>, Yoda <int>, Palpatine <int>, `Boba Fett` <int>,
#   `IG-88` <int>, Bossk <int>, `Lando Calrissian` <int>, Lobot <int>, Ackbar <int>, `Mon Mothma` <int>, `Arvel Crynyd` <int>,
#   `Wicket Systri Warrick` <int>, `Nien Nunb` <int>, `Qui-Gon Jinn` <int>, `Nute Gunray` <int>, `Finis Valorum` <int>, `Jar Jar Binks` <int>,
#   `Roos Tarpals` <int>, `Rugor Nass` <int>, `Ric Olié` <int>, Watto <int>, Sebulba <int>, `Quarsh Panaka` <int>, `Shmi Skywalker` <int>,
#   `Darth Maul` <int>, `Bib Fortuna` <int>, `Ayla Secura` <int>, `Dud Bolt` <int>, Gasgano <int>, `Ben Quadinaros` <int>, `Mace Windu` <int>,
#   `Ki-Adi-Mundi` <int>, `Kit Fisto` <int>, `Eeth Koth` <int>, `Adi Gallia` <int>, `Saesee Tiin` <int>, `Yarael Poof` <int>, `Plo Koon` <int>,
#   `Mas Amedda` <int>, `Gregar Typho` <int>, Cordé <int>, `Cliegg Lars` <int>, `Poggle the Lesser` <int>, `Luminara Unduli` <int>,
#   `Barriss Offee` <int>, Dormé <int>, Dooku <int>, `Bail Prestor Organa` <int>, `Jango Fett` <int>, `Zam Wesell` <int>, `Dexter Jettster` <int>,
#   `Lama Su` <int>, `Taun We` <int>, `Jocasta Nu` <int>, `Ratts Tyerell` <int>, `R4-P17` <int>, `Wat Tambor` <int>, `San Hill` <int>,
#   `Shaak Ti` <int>, Grievous <int>, Tarfful <int>, `Raymus Antilles` <int>, `Sly Moore` <int>, `Tion Medon` <int>, Finn <int>, Rey <int>,
#   `Poe Dameron` <int>, BB8 <int>, `Captain Phasma` <int>, `Padmé Amidala` <int>
# ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names

With zero rows, slightly different note:

dplyr::starwars |> tidyr::pivot_wider(names_from = name, values_from = height) |> dplyr::slice(0)
# A tibble: 0 × 99
# … with 99 variables: mass <dbl>, hair_color <chr>, skin_color <chr>, eye_color <chr>, birth_year <dbl>, sex <chr>, gender <chr>, homeworld <chr>,
#   species <chr>, films <list>, vehicles <list>, starships <list>, Luke Skywalker <int>, C-3PO <int>, R2-D2 <int>, Darth Vader <int>,
#   Leia Organa <int>, Owen Lars <int>, Beru Whitesun lars <int>, R5-D4 <int>, Biggs Darklighter <int>, Obi-Wan Kenobi <int>, Anakin Skywalker <int>,
#   Wilhuff Tarkin <int>, Chewbacca <int>, Han Solo <int>, Greedo <int>, Jabba Desilijic Tiure <int>, Wedge Antilles <int>, Jek Tono Porkins <int>,
#   Yoda <int>, Palpatine <int>, Boba Fett <int>, IG-88 <int>, Bossk <int>, Lando Calrissian <int>, Lobot <int>, Ackbar <int>, Mon Mothma <int>,
#   Arvel Crynyd <int>, Wicket Systri Warrick <int>, Nien Nunb <int>, Qui-Gon Jinn <int>, Nute Gunray <int>, Finis Valorum <int>, Jar Jar Binks <int>,
#   Roos Tarpals <int>, Rugor Nass <int>, Ric Olié <int>, Watto <int>, Sebulba <int>, Quarsh Panaka <int>, Shmi Skywalker <int>, Darth Maul <int>,
#   Bib Fortuna <int>, Ayla Secura <int>, Dud Bolt <int>, Gasgano <int>, Ben Quadinaros <int>, Mace Windu <int>, Ki-Adi-Mundi <int>, Kit Fisto <int>,
#   Eeth Koth <int>, Adi Gallia <int>, Saesee Tiin <int>, Yarael Poof <int>, Plo Koon <int>, Mas Amedda <int>, Gregar Typho <int>, Cordé <int>,
#   Cliegg Lars <int>, Poggle the Lesser <int>, Luminara Unduli <int>, Barriss Offee <int>, Dormé <int>, Dooku <int>, Bail Prestor Organa <int>,
#   Jango Fett <int>, Zam Wesell <int>, Dexter Jettster <int>, Lama Su <int>, Taun We <int>, Jocasta Nu <int>, Ratts Tyerell <int>, R4-P17 <int>,
#   Wat Tambor <int>, San Hill <int>, Shaak Ti <int>, Grievous <int>, Tarfful <int>, Raymus Antilles <int>, Sly Moore <int>, Tion Medon <int>,
#   Finn <int>, Rey <int>, Poe Dameron <int>, BB8 <int>, Captain Phasma <int>, Padmé Amidala <int>
# ℹ Use `colnames()` to see all variable names
@krlmlr
Copy link
Member

krlmlr commented Dec 1, 2022

Thanks, good catch!

@krlmlr krlmlr added the bug an unexpected problem or unintended behavior label Dec 1, 2022
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jun 2, 2023
# pillar 1.9.0

## Features

- Math operations on `num()` objects no longer perform type
  checks. This allows, e.g., multiplying a `num()` with a logical
  (#630, #632).

## Printing

- The Default For The `Pillar.Min_Title_Chars` Option Has been bumped
  up to 20 characters so that title truncuation only affects very long
  variables. Use `options(pillar.min_title_chars = 5)` to reset to the
  previous default (#582, #620).

- Use info bullets to format details (#582, #617, #627, #635).

## Breaking changes

- `colonnade()`, `extra_cols()` and `squeeze()` are now
  hard-deprecated (#272, #374, #631).

## Bug fixes

- Show `colnames()` hint only when needed (tidyverse/tibble#1488, #622).

- Fix printing of very small numbers (#615, #619).

- Shortened list columns are also shown with a subtle style (#628, #634).

- Avoid warning with S4 character classes (tidyverse/tibble#1367, #625).

- Fix method consistency, checked by R-devel (#633).

## Documentation

- Polish `?pillar_options` (#583).

- Fix typo & missing quote in digits vignette stub (@gavinsimpson, #629).

## Internal

- Require vctrs >= 0.5.0
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2023
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

Successfully merging a pull request may close this issue.

2 participants