Skip to content

default destfile in download.file()

2 messages · Jeroen Ooms, Uwe Ligges

#
A nice default value for the `destfile` argument in download.file() would
be `basename(url)` i.e. the name of the downloaded file. This would
correspond to default behavior in many other web/ftp clients and makes code
slightly more concise:

  download.file("https://svn.r-project.org/R/trunk/doc/CRAN_mirrors.csv")
  mirrors <- read.csv("CRAN_mirrors.csv")
1 day later
#
On 18.02.2016 12:01, Jeroen Ooms wrote:
This contradicts our approach not to overwrite files in the user 
filespace that are not explicitly mentioned as an argument.

Best,
Uwe Ligges