Dear list members, The release of R 2.9.0, reminds me of a long-standing nit that I have to pick. I prefer not to transfer and update all of the packages in my old library, because I see a new release of R as an opportunity to start with a clean slate. I'd rather install packages as I need them. My personal solution is to use the following function in place of library():
package <- function(package, dependencies=TRUE, ...){ package <- as.character(substitute(package)) if (!(package %in% .packages(all.available=TRUE))) install.packages(package, dependencies=dependencies) library(package, character.only=TRUE, ...) } I'm sure that this function could be improved, and possibly I've missed a facility that's already available. If not, it would be nice if the library() command automatically tried to download and install missing packages (perhaps if an option is set). Regards, John ------------------------------ John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel