Howto: List All Installed Packages and Versions in R

Use this nifty block of code:

ip <- as.data.frame(installed.packages()[,c(1,3:4)])
rownames(ip) <- NULL
ip <- ip[is.na(ip$Priority),1:2,drop=FALSE]
print(ip, row.names=FALSE)

Which yields something like the following:

            Package   Version
             abind     1.4-5
           acepack     1.4.1
              affy    1.42.3
          affydata    1.12.0
            affyio    1.32.0
           affyPLM    1.40.1
             akima    0.5-12
           annaffy    1.36.0
     AnnotationDbi    1.26.1
               ape       3.5
               arm     1.9-3
         backports     1.0.4
         base64enc     0.1-3
         BatchJobs       1.6
            BBmisc      1.10
             bbmle    1.0.18
                BH  1.62.0-1
           Biobase    2.24.0
      BiocGenerics    0.10.0
     BiocInstaller    1.14.3
      BiocParallel     0.6.1
           biopara       1.5
        Biostrings    2.32.1
            bitops     1.0-6
     blockmodeling     0.1.8
              brew     1.0-6
          BSgenome    1.32.0
               car    2.0-20
           caTools    1.17.1
         checkmate     1.8.2
          classInt    0.1-23
              coda    0.18-1
        colorspace     1.3-1
          combinat     0.0-8
           corpcor     1.6.8
       ......

I've successfully used the above in R/3.1.x and R/3.2.x.

Leave a Reply

Your email address will not be published. Required fields are marked *