Sometimes GNU R has a problem whereby Hadley Wickham recommends:
I'd recommend re-installing all your packages.
The question is how to do this in the best possible way. I know that install.packages
or update.packages
will upgrade all package versions and overwrite existing versions:
update.packages(checkBuilt = TRUE, ask = FALSE)
When using CRAN packages (nothing special from GitHub or other sources), this naive approach worked for me:
my.packages <- rownames(installed.packages());
install.packages(my.packages);
What can I do if I have installed dev versions from GitHub, for example, or used some local packages that are not shared publicly?
What I am looking for is a way to:
How can I address these requirements?
Partial solution for (1) - find out which packages will be upgraded/downgraded:
my.packages <- installed.packages();
my.avail <- available.packages();
z <- merge(
my.packages[,c("Package","Version")],
my.avail[,c("Package","Version")],
by = "Package", suffixes = c('.my','.avail'));
z$Version.my <- as.character(z$Version.my)
z$Version.avail <- as.character(z$Version.avail)
# my packages which will be upgraded
subset(z, Version.my < Version.avail)
# my packages that will be downgraded
subset(z, Version.my > Version.avail)
This is only approximate, I think - depending on dependencies you may not get all the upgrades. But you should see the downgrades to expect if using dev versions?
Another way to upgrade all packages is to use the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With