Question: Retrieve previous R package
0
gravatar for rse
7 weeks ago by
rse70
Singapore
rse70 wrote:

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

bioconductor R • 174 views
ADD COMMENTlink modified 5 days ago by h.mon22k • written 7 weeks ago by rse70

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 REPLYlink written 7 weeks ago by WouterDeCoster35k

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 REPLYlink modified 7 weeks ago • written 7 weeks ago by rse70
3

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 REPLYlink written 7 weeks ago by WouterDeCoster35k

Ok...Thank you for the help.

ADD REPLYlink written 7 weeks ago by rse70

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

ADD REPLYlink written 7 weeks ago by zx87546.2k

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

ADD REPLYlink written 7 weeks ago by rse70
1
gravatar for h.mon
5 days ago by
h.mon22k
Brazil
h.mon22k wrote:

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 COMMENTlink written 5 days ago by h.mon22k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1235 users visited in the last hour