The instructions for loading the package in .Rprofile are currently given as
if (interactive() & requireNamespace("shrtcts", quietly = TRUE)) {
shrtcts::add_rstudio_shortcuts()
}
This has the effect of always executing requireNamespace, even when not in interactive mode. By using short-circuited && instead of &, this PR improves the performance of running non-interactive scripts by never attempting to load the package.
The instructions for loading the package in
.Rprofile
are currently given asThis has the effect of always executing
requireNamespace
, even when not in interactive mode. By using short-circuited&&
instead of&
, this PR improves the performance of running non-interactive scripts by never attempting to load the package.