Checking/updating package versions
1
0
Entering edit mode
bertb • 0
@bertb-18667
Last seen 2.1 years ago
Canada

Hello,

I have a very simple question: how can I check my version of an installed package - in this case DiffBind? I know a simple -v in Unix achieves this, but I can't seem to figure it out in R.

Part of the reason I need to know is because I think my version is out of date now and I need to upgrade. Is there a way to do this without uninstalling and reinstalling the new one? And if I do need to uninstall/reinstall, is there a specific uninstaller, or specific procedure for uninstalling?

Thank you!

DiffBind • 3.0k views
ADD COMMENT
3
Entering edit mode
@james-w-macdonald-5106
Last seen 13 hours ago
United States
library(DiffBind)
packageDescription("DiffBind")$Version

Or more to the point

library(BiocManager)
BiocManager::valid()

After which you can do what valid says you need to do (if anything at all) to make your install valid.

ADD COMMENT
0
Entering edit mode

Thanks James!

When I run

library(BiocManager)
BiocManager::valid()

the output I get details all the packages I have, and at then end how I can update (I think):

Bioconductor version '3.11'

  * 9 packages out-of-date
  * 0 packages too new

create a valid installation with

  BiocManager::install(c(
    "backports", "colorspace", "data.table", "diffobj", "ggrepel", "jsonlite", "rlang", "V8", "vctrs"
  ), update = TRUE, ask = FALSE)

more details: BiocManager::valid()$too_new, BiocManager::valid()$out_of_date

Warning message:
9 packages out-of-date; 0 packages too new

but when I run the above command, and check with BiocManager::valid() , I still receive the same packages that aren't updating. When new versions try to install, I get the following warning

Warning: cannot remove prior installation of package 'V8'
Warning: restored 'V8'

for each package

Is there something else I need to do to update these properly? Thanks again

ADD REPLY
1
Entering edit mode

Well, ideally you would install R-4.0.3 and Bioconductor 3.12 because you need to update. Failing that, you should restart R and try again. Usually when you can't remove a prior installation it's because the package is loaded by R.

ADD REPLY
0
Entering edit mode

I see - thanks. I was running Bioconductor 3.11, so I think that was the issue. When I installed 3.12, almost everything installed properly (latest versions of 3 packages were available with source only). However, part of the output did include:

Installation path not writeable, unable to update packages: codetools, foreign, KernSmooth, Matrix, nlme

...which is curious to me since the downloading path seems basically automated (that is, I haven't specified anything) and all the binary packages are going to \downloaded_packages. I'm just wondering why only these packages would have an issue with the installation path?

Thanks again

ADD REPLY
1
Entering edit mode

Usually on Windows you install R as a privileged user, and the recommended packages (which include all those listed) are also installed in a privileged location that you as a normal user don't have write privileges. Then when you install other packages R chooses a directory that you do have write privileges (on Win10 it's in C:/<yourusername>/AppData/Roaming/R/win-library/4.0, or at least is there on my box).

So if you do this:

> .libPaths()
[1] "C:/Users/jmacdon/AppData/Roaming/R/win-library/4.0"
[2] "C:/Program Files/R/R-4.0.0/library"

You can see that there are two library paths, the first one being your 'local' path to which you have privileges, and the second one being in a place that can only be written to if you invoke admin privileges. An alternative that you sometimes hear people talking about is to run R with admin privileges so you can just have one library dir, but that in general is a horrible idea. You should always use the lowest privilege level possible so you don't inadvertently bork your machine. Or allow nefarious actors easy access to do that for you.

ADD REPLY
0
Entering edit mode

Ok - I'm learning a lot. I'm the only one using R - for now - but perhaps it would be good practice to periodically run as an admin in order to update regularly.

Thanks again for taking the time with this line of questions

ADD REPLY

Login before adding your answer.

Traffic: 750 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