Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase R studio's connection timeout limit

Tags:

curl

r

Is it possible to increase R-studio's connection time out limit? I am getting the following error:

Error in curl::curl_fetch_memory(url, handle = handle) : 
Timeout was reached: Connection timed out after 10000 milliseconds

The below line of code caused the initial error. I am trying to use google speech to text Api through the package 'googleLanguageR'. However, I managed to install 'googleLanguageR' using install.packages("googleLanguageR")and now the code is failing when I try to use the gl_auth function in package googleLanguageR. So it's to do with the connection, hence I want to know if the time out limit can be increased.

devtools::install_github("MarkEdmondson1234/googleLanguageR")

I tried using the below commands to try to increase the limit but still getting the same error.

options(timeout = 4000000) 
timeout(4000000)

This also means that the limit specified in the above commands have not been registered because the error message still appears after 10000 milliseconds. I also tried increasing the limit to 40000, incase the above value was too big but still the same error. The only difference is that the error now times out after 10015 milliseconds. Please help!

like image 720
SAJ Avatar asked Nov 17 '22 22:11

SAJ


1 Answers

I also faced this problem recently when trying to install the stringi packaged. I think it occurs due to a slow internet connection. Run the code below:

options(timeout = max(1000, getOption("timeout")))

This should increase the timeout duration sufficiently.

like image 69
user19159990 Avatar answered Feb 05 '23 04:02

user19159990