HenrikBengtsson / startup

:wrench: R package: startup - Friendly R Startup Configuration
https://henrikbengtsson.github.io/startup/
163 stars 5 forks source link

IDEA: Warn about setting R options that change evaluation behavior #60

Closed HenrikBengtsson closed 5 years ago

HenrikBengtsson commented 6 years ago

For example, although convenient, setting options(stringsAsFactors = FALSE) is likely to cause complicated troubleshooting when running code on another system. It could also break code that assumes the default is TRUE.

HenrikBengtsson commented 5 years ago

Now checking:

with warnings such as:

startup::check(): R option 'encoding' was changed (to 'UTF-8') during startup, cf. Startup. Values other than the default 'native.enc' is known to cause problems. For example, in non-interactive sessions installation of packages with non-ASCII characters (also in source code comments) fails. To set the encoding only in interactive mode, e.g. if (base::interactive()) options(encoding = "UTF-8"). To disable this check, add "encoding" to option 'startup.check.options.ignore'.

startup::check(): R option 'stringsAsFactors' was changed (to 'FALSE') during startup, cf. Startup. Values other than the default 'TRUE' is known to cause problems. To disable this check, add "stringsAsFactors" to option 'startup.check.options.ignore'.