Reputation: 2431
In readr()/read_csv, how to import data with all columns as character? Thanks!
library(tidyverse)
read_csv(readr_example("mtcars.csv")))
Upvotes: 4
Views: 5572
Reputation: 1
Update: use list(.default = col_character()))
if cols(.default = col_character()))
doesn't work for you.
Upvotes: 0
Reputation: 1054
You can pick a default column type using:
read_csv(readr_example("mtcars.csv"), col_types = cols(.default = col_character()))
The cols
specification will also let you define specific columns as well.
Upvotes: 5