csgillespie/efficientR

2.4.5 stringsAsFactors=FALSE verbiage outdated?

engineerchange opened this issue · 4 comments

Currently, 2.4.5 references options(stringsAsFactors=FALSE) as a .Rprofile preset that can make code less portable. R 4.0.0 made stringsAsFactors=FALSE the default behavior, so recommend re-write or suggest different non-portable example in .Rprofile file.

Snippet:

Try to avoid adding options to the start-up file that make your code non-portable. For example, adding options(stringsAsFactors = FALSE) to your start-up script has knock-on effects for read.table and related functions including read.csv, making them convert text strings into characters rather than into factors as is default. This may be useful for you, but can make your code less portable, so be warned.

👍 definitely one we can happily move on from now.

P.s. if you want to have a 1st bash at a fix for R 4.0.0 PRs are welcome. I plan to get back to this over the weekend if not.

Going to add a note that 3.4.1 has similar verbiage re: stringsAsFactors=FALSE default behaviour.

Awesome, I plan to look at this properly over the weekend.