-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Adding options(stringAsFactors = FALSE) [episode 11] #393
Comments
Hi Duy, thanks for your comment! Episode 11 already has an entire section on stringsAsFactors = FALSE in the reading of csv files, so I would put it there. I don't want to keep adding material due to length, but it is a useful trick and I think one sentence at the end of the section would be fine. The trick is to avoid adding an entire section on options, but maybe another sentence linking to where to find more information about options would solve this. I'd be willing to review a pull request on this topic, if you or anyone else wants to work on it. The file to issue the PR against is located in the |
Hi @duytpm16: Are you interested in starting the PR Diya suggested or should someone else do it? |
Issue is a bit stale and perhaps is ready to be closed? It will also become a non-issue in R 4.0+, as the shift towards stringsAsFactors=FALSE default will be incorporated by then (hopefully). https://developer.r-project.org/Blog/public/2020/02/16/stringsasfactors/index.html |
Yup, this is part of the discussion on migration (more here), and shouldn't be an issue at the moment. Closing for now. Thanks @taddallas @diyadas and @katrinleinweber ! |
Hi,
Would it be worth mentioning to learners that having the line of code, options(stringAsFactors = FALSE), at the beginning of a script is another solution to prevent R from converting strings to factors?
Particularly in 11. Reading and Writing CSV files or 12. Factors (under Default Behavior)
I find this trick very useful because I don't have to manually set stringAsFactors to FALSE when I'm reading in multiple files that I know do not contain categorical variables.
Duy Pham
The text was updated successfully, but these errors were encountered: