Overriding the default column

It’s also possible to override the default column by switching from list() to cols() and specifying .default, or to read in only the columns you specify using cols_only().

another_csv <- "
x,y,z
1,2,3"

read_csv(
  another_csv, 
  col_types = cols(.default = col_character())
)
## # A tibble: 1 × 3
##   x     y     z    
##   <chr> <chr> <chr>
## 1 1     2     3
read_csv(
  another_csv,
  col_types = cols_only(x = col_character())
)
## # A tibble: 1 × 1
##   x    
##   <chr>
## 1 1