this is part of a script I use to document every now and then the packages I have stored by major R version change
# using package_info for the extra info delivered
### -> you might need to change the lib.loc according to system/version
allpkgs <- (devtools:::package_info(rownames(installed.packages(lib.loc = "/Library/Frameworks/R.framework/Versions/3.5/Resources/library")),include_base = T))
allpkgs[grepl("Bioconductor",allpkgs$source),]
# in a similar fashion, for cran/CRAN packages, and leading edge packages you might have got from Github repos
allpkgs[grepl("cran",allpkgs$source,ignore.case = TRUE),]
allpkgs[grepl("Github",allpkgs$source),]
There might be other ways to do it, but I found this to be relatively robust. If others have alternative solutions, I'd be also happy to check them out ;)
I think I wrote my piece of code before the nice
sessioninfo
came out, and sticked to that since it was working :DI think yours has fewer steps and is easier to understand. This seems a rather neat combination:
I think the OP can be quite satisfied with the material over here, the latest one is nice & compact indeed