You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting a cryptic message when reading a .csv file with readr 1.4.0, providing the col_types argument:
Error in read_tokens_(data, tokenizer, col_specs, col_names, locale_, : Invalid input type, expected 'character' actual 'double'
The same file reads correctly:
Without providing the col_types argument
In readr 1.3.1 with the exact same call (including the col_types argument)
I cannot share the file as it contains patient data and don't have a better reprex, but I am sharing it here in hope others who encounter the error will find this and learn that they may work around it by installing 1.3.1 and hopefully they will be able to share their files. I understand that it is hard to take action on the issue without a reprex. Sorry if this is not appropriate and thanks for all the hard work on the package.
The text was updated successfully, but these errors were encountered:
I had an issue with the same error.
The error was caused by col_factor(levels = c(1, 2, 3, 4)). It was fine with the previous version of readr (don't remember what I had before). With readr 1.4.0 I've got: Error in read_tokens_(data, tokenizer, col_specs, col_names, locale_, : Invalid input type, expected 'character' actual 'double'
The error was solved with making the levels vector as a character vector col_factor(levels = c('1', '2', '3', '4')).
readr now throws a more informative error in this case. However passing non-character vectors as levels is still an error and needs to be fixed in your code.
I am getting a cryptic message when reading a .csv file with readr 1.4.0, providing the
col_types
argument:The same file reads correctly:
col_types
argumentcol_types
argument)I cannot share the file as it contains patient data and don't have a better reprex, but I am sharing it here in hope others who encounter the error will find this and learn that they may work around it by installing 1.3.1 and hopefully they will be able to share their files. I understand that it is hard to take action on the issue without a reprex. Sorry if this is not appropriate and thanks for all the hard work on the package.
The text was updated successfully, but these errors were encountered: