fread
from the data.table
package.
read_logs(start=Sys.Date()-30L, end=Sys.Date(), dir="cran-mirror", verbose=TRUE)
YYYY-MM-DD
). Default is Sys.Date()-30L
.YYYY-MM-DD
). Default is Sys.Date()
../cran-mirror
.TRUE
provides informative messages to the console.c("date", "time", "package", "country", "ip_id")
. NULL
loads all columns.data.table
of all the download logs that are available between start
and end
dates.
read_logs
downloads all missing logs from start
until end
to the directory provided in dir
. After downloading all the logs, they will be automatically replaced with corresponding unzipped versions. Logs for which an unzipped version already exists will be skipped. If a log that was downloaded was corrupted, download + unzip will be attemped once again. If it fails the second time as well, that log is skipped.Following that the logs will be read in using data.table::fread
.
As long as unzipped logs exist in the directory, they won't be downloaded again. So, it is preferred to keep using the same directory without deleting the logs that've been already downloaded, to save time.
stats_logs
, plot_logs
## Not run: # ## download all available logs for the last 31 days # dt = read_logs(dir="./cran-mirror", verbose=TRUE) # ## End(Not run)