R packages reinstalled

I should only need to install the R packages once unless I update my R version. However, after I install the packages in RStudio, close it and open it next time, I need to reinstall many packages that I have installed before. Some packages are saved, but I have to reload many others. I really want to know why is that and how to solve this problem. I do not want to reinstall packages every time.

Thank you!

Hi! Welcome!

You're right, that shouldn't be happening! I think it's going to take some more information to diagnose what's going on. Can you try the following?

  1. Try to install one of the packages that keeps needing to be reinstalled
  2. Copy and paste here all of the output you get in the console (if the forum software complains that it's too long, you can also post it as a GitHub gist or Pastebin paste and post the link)
  3. Copy and paste here the results of running sessionInfo() and RStudio.Version()

install.packages("dplyr")
Installing package into ‘C:/Users/Ryan Allen/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/dplyr_0.7.6.zip'
Content type 'application/zip' length 3054705 bytes (2.9 MB)
downloaded 2.9 MB

package ‘dplyr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Ryan Allen\AppData\Local\Temp\RtmpiWtIX2\downloaded_packages
sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] colorspace_1.3-2 scales_1.0.0 compiler_3.5.1 plyr_1.8.4 lazyeval_0.2.1
[6] tools_3.5.1 pillar_1.3.0 gtable_0.2.0 yaml_2.2.0 tibble_1.4.2
[11] crayon_1.3.4 Rcpp_0.12.18 ggplot2_3.0.0 grid_3.5.1 rlang_0.2.2
[16] munsell_0.5.0

Version:1.0 StartHTML:0000000107 EndHTML:0000001490 StartFragment:0000000127 EndFragment:0000001472

RStudio.Version() `citation` To cite RStudio in publications use: RStudio Team (2016). RStudio: Integrated Development for R. RStudio, Inc., Boston, MA URL http://www.rstudio.com/. A BibTeX entry for LaTeX users is @Manual{, title = {RStudio: Integrated Development Environment for R}, author = {{RStudio Team}}, organization = {RStudio, Inc.}, address = {Boston, MA}, year = {2016}, url = {http://www.rstudio.com/}, } mode [1] "desktop" $version [1] ‘1.1.383’