gadenbuie / shrtcts

Make Anything an RStudio Shortcut
https://pkg.garrickadenbuie.com/shrtcts/
Other
119 stars 4 forks source link

Change documentation to improve performance for scripts #10

Closed klmr closed 4 years ago

klmr commented 4 years ago

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.

gadenbuie commented 4 years ago

Thanks for catching the typo!