link.html.help <- function(verbose=FALSE, lib.loc=.libPaths()) { if(!file.exists(file.path(R.home("doc"), "html", "search"))) return(invisible(NULL)) if(verbose) { cat(gettext("updating HTML package descriptions\n")) flush.console() } make.packages.html(lib.loc) make.search.html(lib.loc) fixup.libraries.URLs(lib.loc) } make.packages.html <- function(lib.loc=.libPaths()) { f.tg <- file.path(R.home("doc"), "html", "packages.html") f.hd <- file.path(R.home("doc"), "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:///", URLencode(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, " |