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

duytpm16 opened this Issue Sep 10, 2018 · 1 comment


None yet
2 participants

duytpm16 commented Sep 10, 2018


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


This comment has been minimized.


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 changed the title from options(stringAsFactors = FALSE) to Adding options(stringAsFactors = FALSE) [episode 11] Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment