Last active
December 18, 2015 07:59
-
-
Save ramnathv/5750561 to your computer and use it in GitHub Desktop.
Code to Download RStudio Logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's an easy way to get all the URLs in R | |
start <- as.Date('2012-10-01') | |
today <- as.Date('2013-06-10') | |
all_days <- seq(start, today, by = 'day') | |
year <- as.POSIXlt(all_days)$year + 1900 | |
# this line is modified from the version on the rstudio blog | |
urls <- paste0('http://cran-logs.rstudio.com/', year, '/', all_days, '.csv.gz') | |
# You can then use download.file to download into a directory. | |
# If you only want to download the files you don't have, try: | |
missing_days <- setdiff(all_days, tools::file_path_sans_ext(dir(), TRUE)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment