rawimport <- readLines("http://wiki.r-project.org/rwiki/doku.php?id=tips:tips&do=export_raw") linkIndex <- grep('\\* \\[\\[', rawimport) majorHeadings <- grep('====', rawimport) minorHeadings <- grep("\\* \\*\\*",rawimport) linkIndex <- sort(c(linkIndex, majorHeadings, minorHeadings)) cleanedlinks <- gsub( " \\* \\[\\[","", gsub("]]", "" , rawimport[linkIndex])) cleanedlinks <- cleanedlinks[-1] htmlout <- "alltips.html" ### head of the page wikihead <- c("", "", "
", " ", "This is a snapshot of tips section in the new R Wiki. This snapshot was taken on %s. It is presented as a convenience for readers, who are always encouraged to double-check the wiki itself for the latest version: %s
' ,format(Sys.time(), "%b %d %Y"),wikiwikiaddress,wikiwikiaddress) cat(headerPara1, file=htmlout, append=TRUE) cat('