Retrieve previous R package
1
0
Entering edit mode
6.0 years ago
rse ▴ 100

Hi,

I installed an R package which was already installed and it overwrote my previous R package (that had data in it). How should i retrieve my previous R package?

Thanks

R bioconductor • 4.4k views
ADD COMMENT
0
Entering edit mode

R packages do generally not have user data in there - and I don't think you would overwrite it by installing a new version. Can you elaborate and be more specific?

ADD REPLY
0
Entering edit mode

Thanks for your response. I have put some data myself on extdata folder which had example files to run. I installed again using biocLite as a package was missing. But i cannot find my data now.

ADD REPLY
3
Entering edit mode

Right. That maybe wasn't the best place for you to save data. I don't think recovery is possible - but I'm not an expert in R packages so we can wait a little longer to see if someone has a different idea.

ADD REPLY
0
Entering edit mode

Ok...Thank you for the help.

ADD REPLY
0
Entering edit mode

Provide more details, what package is it? How did you save your data, share the code? Output of sessionInfo() would help.

ADD REPLY
0
Entering edit mode

Thank you for the help. I think i will be able to find the data in backup. Cheers.

ADD REPLY
1
Entering edit mode
5.9 years ago
h.mon 35k

Just to bring closure to this thread - this is essentially WouterDeCoster comment above, with a bit more of detail.

You can get / check your packages library tree with .libPaths(). If you install packages without specifying a location, they are installed at the first element of .libPaths(). When a newer version of the package is installed, the old version is completely wiped out, and no recovery of the old version is possible. Your only chance of recovering the old data is if the newer version has been installed at a different location at the packages library tree. For example, in my computer:

.libPaths()
[1] "/home/h.mon/R/x86_64-pc-linux-gnu-library/3.5"
[2] "/usr/local/lib/R/site-library"                      
[3] "/usr/lib/R/site-library"                            
[4] "/usr/lib/R/library"
  

So there are four possible places to search for the old package. Anyway, it is unlikely the package will be at a different location than your personal R library (the one at your /home folder), the "/usr/local" and "/usr/lib" are system-wide installs and need administrator privilege.

ADD COMMENT

Login before adding your answer.

Traffic: 3010 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6