Hacker News new | ask | show | jobs
by mapcar 4280 days ago
Again, if you remember to include options(stringsAsFactors=FALSE) at the top of your scripts, they are transferable. With other R neophytes who only run code that I write, I tell them to run

cat("options(stringsAsFactors=FALSE)\n",file="~/.Rprofile",append=TRUE)

at the R console.

2 comments

And I'd tell you no.

And to the GP, adding that to consumable code, particularly a distributed package, is generally seen as impolite behavior. What happens if I load your package and then another one which assumes the standard default?

If you absolutely must mess with peoples options, the way to do it is capture the original state, modify the option, make your affected call and then restore the original options.

I do agree that for my purposes I generally would prefer that as the default but even after using R for ~15 years I don't see it as some huge burden to specify it each time.

gotcha, thanks!