0

RStudio automatically loads packages and I am trying to find out, how it is possible as I am not using .RData .RProfile or any other script (all deleted). However, when starting RStudio, a bunch of packages is loaded example "zoo", but it is shown that it is not activated in R (see picture). Is there any connection with:

dput(loadedNamespaces())
c("**zoo**", "tidyselect", "xfun", "shinyjs", "purrr", "corrplot", 
"urca", "lattice", "vars", "colorspace", "vctrs", "generics", 
"usethis", "htmltools", "yaml", "grDevices", "utf8", "rlang", 
"pillar", "glue", "DBI", "forecast", "TTR", "lifecycle", "quantmod", 
"timeDate", "munsell", "gtable", "evaluate", "knitr", "tseries", 
"strucchange", "lmtest", "parallel", "curl", "fansi", "methods", 
"xts", "Rcpp", "scales", "fs", "fracdiff", "ggplot2", "stats", 
"datasets", "graphics", "digest", "stringi", "dplyr", "grid", 
"quadprog", "tools", "sandwich", "magrittr", "tibble", "crayon", 
"pkgconfig", "MASS", "ellipsis", "rsconnect", "utils", "assertthat", 
"rmarkdown", "base", "R6", "nnet", "nlme", "compiler")

and

.libPaths()
"C:/Users/HP/Documents/R/win-library/4.0" "C:/Program Files/R/R-4.0.2/library"   

It is slowing my work as I have to way a long time to start RStudio. Any help?

enter image description here

Jaroslav Kotrba
  • 283
  • 1
  • 14
  • You say you're not using .RData but do you have the "Restore .RData into workspace at startup" checked in your global options? – Dason Aug 10 '21 at 14:26
  • Does this answer your question? [Load only basic Packages at the beginning of a session in R](https://stackoverflow.com/questions/68708280/load-only-basic-packages-at-the-beginning-of-a-session-in-r) – Rory S Aug 10 '21 at 14:27
  • "Restore .RData into workspace at startup" is unchecked and "Never" chosen. This is my question too, however, it was not answered... – Jaroslav Kotrba Aug 10 '21 at 14:27

1 Answers1

0

You mentioned you deleted your .RData and .RProfile, but take a look at your R_DEFAULT_PACKAGES setting, which is part of .Reviron. This documentation might be helpful:

https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/Startup

# NOT RUN {
## Example ~/.Renviron on Unix
R_LIBS=~/R/library
PAGER=/usr/local/bin/less

## Example .Renviron on Windows
R_LIBS=C:/R/library
MY_TCLTK="c:/Program Files/Tcl/bin"

## Example of setting R_DEFAULT_PACKAGES (from R CMD check)
R_DEFAULT_PACKAGES='utils,grDevices,graphics,stats'
# this loads the packages in the order given, so they appear on
# the search path in reverse order.
}

Do you use multiple environments? This may be relevant as well: https://environments.rstudio.com/r-installation

The answers here are the reverse (how to load packages automatically) and includes several troubleshooting steps if you're looking to NOT load packages automatically.

How to load packages in R automatically?