I am trying to connect to a database to read a table to R, but it is giving me connection timeout errors at times. I have tried changing the connection attributes, but nothing worked 100 percent of the time. Is there a way to run the code multiple times until a data frame is created?.
This is the code sample I am using to read the table and it works most of the time, but I would like this code to run multiple times until it connects and creates the required dataframe.
Dataframe <- dataset.load(name = "Connection name", query = paste("Select * from table"),connect_params=list(socketTimeout=100, loginTimeout=100))