efficientR icon indicating copy to clipboard operation
efficientR copied to clipboard

2.4.5 stringsAsFactors=FALSE verbiage outdated?

Open engineerchange opened this issue 5 years ago • 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.

engineerchange avatar May 03 '20 20:05 engineerchange

:+1: definitely one we can happily move on from now.

Robinlovelace avatar May 04 '20 09:05 Robinlovelace

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.

Robinlovelace avatar May 04 '20 09:05 Robinlovelace

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

engineerchange avatar May 07 '20 05:05 engineerchange

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

Robinlovelace avatar May 07 '20 08:05 Robinlovelace