win.packages.html <- function(lib.loc=.libPaths(), docdir = R.home("doc"), libdir = .Library) { f.tg <- file.path(docdir, "html", "packages.html") f.hd <- file.path(docdir, "html", "packages-head-utf8.html") if(!file.create(f.tg)) { warning("cannot update HTML package index") return(FALSE) } file.append(f.tg, f.hd) out <- file(f.tg, open="a") rh <- chartr("\\", "/", R.home()) drive <- substring(rh, 1, 2) for (lib in lib.loc) { pg <- sort(.packages(all.available = TRUE, lib.loc = lib)) ## use relative indexing for .Library if(is.na(pmatch(rh, lib))) { libname <- chartr("/", "\\", lib) lib0 <- if(substring(lib, 2, 2) != ":") paste(drive, lib, sep="") else lib lib0 <- paste("file:///", lib0, sep="") } else { lib0 <- "../../library" libname <- "the standard library" } if(length(lib.loc) > 1) cat("
Cross-links from this library to other libraries may not work.\n\n", file = out) cat("
\n
| ', i, " | ", title, " |