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

Reconsider/remove message after read_*() #1532

Open
mine-cetinkaya-rundel opened this issue Jan 29, 2024 · 1 comment
Open

Reconsider/remove message after read_*() #1532

mine-cetinkaya-rundel opened this issue Jan 29, 2024 · 1 comment

Comments

@mine-cetinkaya-rundel
Copy link
Member

The following is the current result of reading a CSV file:

library(readr)

mtcars <- read_csv(readr_example("mtcars.csv"))
#> Rows: 32 Columns: 11
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Created on 2024-01-29 with reprex v2.0.2

I think the message can be entirely removed.

  • The info items can be confusing for new learners who will either learn to ignore messages (which is what experienced folks do most of the time when they see this message) or get confused about whether they must act on the suggestions or they can act on them.
  • As suggested in read_csv() et al. report delimiter #1469, the reporting of the delimiter is redundant for functions like read_csv(), read_tsv(), etc.

We discussed the possibility of a package or tidyverse level strict option where the user would have to specify column types (which is preferable for production settings), but for most interactive usage the messaging is either unnecessary or confusing (particularly to new learners).

At a minimum, I'd suggest removing the info items.

@jennybc
Copy link
Member

jennybc commented Jan 29, 2024

To further elaborate on the problems, the advice on how to use spec() is also pretty underwhelming. Because you can't just call spec(), you need to call it on the results of read_csv(), so we aren't giving a particularly useful hint and there's no obvious way to fix that.

> spec()
Error in spec() : argument "x" is missing, with no default
Run `rlang::last_trace()` to see where the error occurred.
> spec(mtcars)
cols(
  mpg = col_double(),
  cyl = col_double(),
  disp = col_double(),
  hp = col_double(),
  drat = col_double(),
  wt = col_double(),
  qsec = col_double(),
  vs = col_double(),
  am = col_double(),
  gear = col_double(),
  carb = col_double()
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants