smart_download | R Documentation |
Download only those files that don't already exist
smart_download(obj, src, new_filenames = basename(src), clobber = FALSE, ...)
obj |
an |
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 |
clobber |
do you want to clobber any existing files? |
... |
arguments passed to |
Downloads only those files in src
that are not already present in
the directory specified by the raw_dir
attribute of obj
.
idiom courtesy of Hadley Wickham
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.