I need to read several different data inputs with read_csv(). I have somewhere saved the column types, which I want to use to check errors. My question is: how do I turn a string with columns types into a cols() object.
For example, this works:
But I need something like this:
aa <- c('c','n') cols(aa)
This second call gives me an error:
> aa <- c('c','n')
Error in switch(x,
?= col_guess(), c = col_character(), : EXPR must be a length 1 vector