filedownload: filedownload

Description Usage Arguments Value Examples

View source: R/filedownload.R

Description

This is an accesory function that catch error when downloading zip files It is OS dependent, using "curl" in Linux and "auto" in Windows.

Usage

1
filedownload(url, filename)

Arguments

url

url of the file (currently a .zip)

filename

name of the downloaded file

Value

it returns the error or warning in case it has been producen. Otherwise it just download the file into the desired filename directory

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# Download zip with municipality concello (in case it does not exist)
tempzip <- paste0(temp, concello, '.zip')
if(!file.exists(tempzip)){
                getzip <- filedownload(URLencode(ziplink), tempzip)
                } else {
                        cat("Not downloading PBA --> ", concello, "--> already exists")
                        }

## End(Not run)

cesarkero/PBADownloader documentation built on Feb. 2, 2021, 12:24 a.m.