user1605665
user1605665

Reputation: 4161

How do i set a timeout for utils::download.file() in R

I'm trying to download a file that requires more than 60 seconds using download.file() function. The documentation mentions the timeout option e.g.

The timeout for many parts of the transfer can be set by the option timeout which defaults to 60 seconds.

When i try to set it i get an error message

download.file("https://server/FileURL", destfile = "file.xml", timeout = 444)

Example Message

unused argument (timeout = 444)

Upvotes: 54

Views: 32649

Answers (1)

Rorschach
Rorschach

Reputation: 32466

To retrieve an option

getOption('timeout')
# [1] 60

To set an option

options(timeout=100)

Upvotes: 95

Related Questions