Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back stringsAsFactors? #1542

Open
jxu opened this issue May 21, 2024 · 0 comments
Open

Bring back stringsAsFactors? #1542

jxu opened this issue May 21, 2024 · 0 comments

Comments

@jxu
Copy link

jxu commented May 21, 2024

I know R's read.csv stringsAsFactors option has caused a lot of confusion over the years, but I think it is a genuinely useful option to have (defaulting to FALSE). Most of the data I work with has categorical data in CSV (which has everything as strings), and the current solution is to use dplyr mutate/across/where to change many columns at once, which is ok but could be nicer handled at the data input stage. AFAIK col_types doesn't have a cols guess_strings_as_factors option.

Stack Overflow request to show it is a real-world problem https://stackoverflow.com/questions/40367163/importing-unquoted-strings-as-factors-using-read-csv-from-the-readr-package-in-r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant