AndreaCirilloAC / updateR

update your R version in a breeze ( on OSX) √
Other
143 stars 24 forks source link

Error in install.packages : object 'needed_packages' not found #21

Open prestongreene opened 6 years ago

prestongreene commented 6 years ago

After successfully updating R from 3.3. to 3.5 using updateR() from RStudio and selecting "yes" to restarting R, I got the following message:

install.packages(as.vector(needed_packages))
Error in install.packages : object 'needed_packages' not found
R version change [3.3.3 -> 3.5.0] detected when restoring session; search path not restored

It also looks like my old packages are no longer installed.

Here is my sessionInfo():

sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0
cring-toxstrategies commented 6 years ago

I am having exactly the same problem. My sessionInfo() is identical to that listed above. The only difference is that I was upgrading from R version 3.4.3.

Everything went smoothly, R was updated to R version 3.5.0 (2018-04-23) -- "Joy in Playing" Also the packages installed on your previous version of R were restored [At this point RStudio told me it was trying to update loaded packages and asked to restart, so I said yes] Restarting R session... > install.packages(as.vector(needed_packages)) Error in install.packages : object 'needed_packages' not found R version change [3.4.3 -> 3.5.0] detected when restoring session; search path not restored

Here's the list of packages that seem to be currently installed after running updateR() -- it seems that the only ones remaining are those that ship with R ("base" or "recommended" priority).

> installed.packages()[, "Priority"]
         base          boot         class       cluster     codetools      compiler 
       "base" "recommended" "recommended" "recommended" "recommended"        "base" 
     datasets       foreign      graphics     grDevices          grid    KernSmooth 
       "base" "recommended"        "base"        "base"        "base" "recommended" 
      lattice          MASS        Matrix       methods          mgcv          nlme 
"recommended" "recommended" "recommended"        "base" "recommended" "recommended" 
         nnet      parallel         rpart       spatial       splines         stats 
"recommended"        "base" "recommended" "recommended"        "base"        "base" 
       stats4      survival         tcltk         tools         utils 
       "base" "recommended"        "base"        "base"        "base"
AndreaCirilloAC commented 6 years ago

hi @prestongreene and @cring-toxstrategies , package restoring is one of the last features developed so thank you for the precious feedback. Going to work on this.

seantma commented 6 years ago

@prestongreene @cring-toxstrategies Have you tried using the plain R app to run updateR() rather thru Rstudio? This solution worked for me as I had similar issues when updating thru Rstudio.

ogamel commented 6 years ago

I have the same issue. Any solution?

LunaSare commented 6 years ago

I am also getting an Error in install.packages : object 'needed_packages' not found when running updateR() in RStudio. But running it from plain R instead of RStudio worked for me.

AndreaCirilloAC commented 6 years ago

thank you @LunaSare @seantma , I am trying to get which is the difference among running updateR() trough R and Rstudio. Any idea about that?

fennuluotuo commented 5 years ago

I have the same issue. Any solution?

debusklaneml commented 5 years ago

I also had this same problem.

> install.packages(as.vector(needed_packages)) Error in install.packages : object 'needed_packages' not found R version change [3.5.0 -> 3.6.0] detected when restoring session; search path not restored

Obviously, because the new R is installed and this operation failed, my old packages are gone.

AndreaCirilloAC commented 5 years ago

Hi @fennuluotuo and @debusklaneml . Have you tried the workaround suggested by @seantma ? Thanks

AndreaCirilloAC commented 5 years ago

Plus, I have added a disclaimer on this within the package Readme and will do the same on package loading. Thank you all for pointing this out.

releesha commented 5 years ago

I had the same problem. First, I tried to install the needed package in plain R then, I do it in RStudio. It worked. Thank you @seantma

mikeroswell commented 4 years ago

Still running into issues with this, see https://stackoverflow.com/a/38619239/8400969. However, I suspect the package worked, even though I got this Error message, as when I restarted R it had updated to 3.6.2 and it looked like most of my packages survived the update as well.