In readr, where combine using parameter col_names = TRUE
and col_character
as below code3, it's failed and the error message as attached image. Anyone can help on this ? Thanks!
library(tidyverse)
# code1 ok
read_csv("a,b,c
1,2,3
4,5,6",col_character)
# code2 ok
read_csv("a,b,c
1,2,3
4,5,6",col_names = TRUE)
# code3 :failed
read_csv("a,b,c
1,2,3
4,5,6",col_names = TRUE,col_character)
wrap it around
cols
, e.g.