download_Rcpp_releases <- function(){ # download archived versions url <- "http://cran.r-project.org/src/contrib/Archive/Rcpp/" rx <- '^.*(Rcpp_.*?gz).*?right">([^\\s>]*?)\\s.*?right">\\s?([^>]*?)<.*$' lines <- readLines( url ) archives <- gsub( rx, "\\1", grep( rx, lines, value = TRUE) ) sapply( archives, function(.) download.file(sprintf( "%s%s" , url, .),.) ) # download the last version download.file( "http://cran.r-project.org/src/contrib/Rcpp_0.8.9.tar.gz", "Rcpp_0.8.9.tar.gz" ) invisible(NULL) }