Search code examples
rcsvverbosity

Silence vroom::vroom?


vroom::vroom() gives a quite verbose message to console. For example:

> my_data = vroom::vroom("my_data.csv")

## Rows: 6,608                                                                                                                                                                                                                                                           
## Columns: 9
## Delimiter: ";"
## chr  [2]: panel_rev, pcb_rev
## dbl  [5]: panel_id, panel_type, work_order_lot_id, location_id, panel_number
## dttm [2]: marking_dt, created_dt
## 
## Use `spec()` to retrieve the guessed column specification
## Pass a specification to the `col_types` argument to quiet this message

Is there a way to silence it other than my_data = suppressMessages(vroom::vroom("my_data.csv")) or is this the preferred way?


Solution

  • Not sure if these are new features since this question was answered, but setting progress = FALSE and the col_types = cols() can be used to silence vroom::vroom completely. The col_types = cols() is common across most tidyverse data loading functions:

    my_data <- vroom::vroom("my_data.csv", progress = FALSE, col_types = cols())