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

Adding options(stringAsFactors = FALSE) [episode 11] #393

Closed
duytpm16 opened this issue Sep 10, 2018 · 4 comments
Closed

Adding options(stringAsFactors = FALSE) [episode 11] #393

duytpm16 opened this issue Sep 10, 2018 · 4 comments
Labels
status:changes requested Waiting for Contributor to update PR type:enhancement Propose enhancement to the lesson

Comments

@duytpm16
Copy link

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

@diyadas
Copy link
Contributor

diyadas commented Sep 10, 2018

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 _episodes_rmd directory.

@diyadas diyadas added good first issue Good issue for first-time contributors help wanted Looking for Contributors type:enhancement Propose enhancement to the lesson labels Sep 11, 2018
@diyadas diyadas changed the title options(stringAsFactors = FALSE) Adding options(stringAsFactors = FALSE) [episode 11] Nov 16, 2018
@katrinleinweber
Copy link
Contributor

Hi @duytpm16: Are you interested in starting the PR Diya suggested or should someone else do it?

@diyadas diyadas added status:changes requested Waiting for Contributor to update PR and removed good first issue Good issue for first-time contributors help wanted Looking for Contributors labels May 8, 2019
@taddallas
Copy link

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

@HaoZeke
Copy link
Member

HaoZeke commented Jul 12, 2020

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 !

@HaoZeke HaoZeke closed this as completed Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:changes requested Waiting for Contributor to update PR type:enhancement Propose enhancement to the lesson
Projects
None yet
Development

No branches or pull requests

5 participants