smart_download {etl}R Documentation

Download only those files that don't already exist

Description

Download only those files that don't already exist

Usage

smart_download(obj, src, new_filenames = basename(src), clobber = FALSE, ...)

Arguments

obj

an etl object

src

a character vector of URLs that you want to download

new_filenames

an optional character vector of filenames for the new (local) files. Defaults to having the same filenames as those in src.

clobber

do you want to clobber any existing files?

...

arguments passed to download

Details

Downloads only those files in src that are not already present in the directory specified by the raw_dir attribute of obj.

Author(s)

idiom courtesy of Hadley Wickham

Examples

## Not run: 
cars <- etl("mtcars")
urls <- c("https://raw.githubusercontent.com/beanumber/etl/master/etl.Rproj",
"https://www.reddit.com/robots.txt")
smart_download(cars, src = urls)
# won't download again if the files are already there
smart_download(cars, src = urls)
# use clobber to overwrite
smart_download(cars, src = urls, clobber = TRUE)

## End(Not run)

[Package etl version 0.4.1 Index]