【问题标题】:How to start R without packages loaded如何在不加载包的情况下启动 R
【发布时间】:2021-10-11 02:20:27
【问题描述】:

当我启动 R (RStudio) 时,我总是从这些包开始:

dput(loadedNamespaces())

c("zoo", "tidyselect", "xfun", "shinyjs", "purrr", "corrplot", 
"urca", "lattice", "vars", "colorspace", "vctrs", "generics", 
"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", "fracdiff", "ggplot2", "stats", "datasets", "graphics", 
"digest", "stringi", "dplyr", "grid", "quadprog", "tools", "sandwich", 
"magrittr", "tibble", "crayon", "pkgconfig", "ellipsis", "MASS", 
"rsconnect", "utils", "assertthat", "rmarkdown", "base", "R6", 
"nnet", "nlme", "compiler")

我搜索了 .Rprofile,但它返回的 .RData 相同。

(my_rprofile <- file.path(Sys.getenv("R_USER"), ".RProfile"))
file.exists(my_rprofile)
file.exists(".RProfile")

重新安装 R 也没有帮助。我很想只从基本包开始 R。

感谢您的帮助

【问题讨论】:

  • 你在使用 RStudio 吗?如果是这样,请编辑标签。
  • 我怀疑您正在加载已保存的工作区。转到 RStudio 中的 全局选项 并删除相关的复选标记。
  • 感谢您的回复,我已取消选中“启动时将 .RData 还原到工作区”,但它没有帮助。

标签: r rstudio


【解决方案1】:

听起来很像您在某个地方有一个 .Rprofile,它在启动时加载了一些包。

您可以尝试启动without loading any profiles 吗?在 Rstudio 中,您只需选中 Project Options -&gt; Disable .Rprofile execution on session start / resume 选项即可。见截图:

【讨论】:

  • 感谢您的回答,问题是我没有使用任何项目,我只使用脚本,而且似乎无法打开图片选项卡。
  • 如果您创建一个项目然后选中该选项会发生什么?
  • 好吧,基本上没有改变仍然加载包。我搜索了 .Rprofile 和 .RData 删除了所有...但仍然是同样的问题。
  • 我希望在开始时只加载基本包...
猜你喜欢
  • 2011-10-22
  • 1970-01-01
  • 2012-07-25
  • 1970-01-01
  • 1970-01-01
  • 2020-01-23
  • 2015-05-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多