I have a code and I use a loop inside it, now I want this loop to be stopped for a short time after the completion of one request. But when this loop executes the next request, I want it to be stopped at a different time interval. For example, for After the first request - 10 seconds. After the second request - 15 seconds, etc.
Below is a loop
for (i in 1:nrow(uniquemail)) {
k <- 2
test3 <- subset(finaltest, finaltest$Email == uniquemail[i,1])
for (j in 1:nrow(test3)) {
uniquemail[i,k] <- test3[j,2]
uniquemail[i,k+1] <- as.character(test3[j,3])
uniquemail[i,k+2] <- as.numeric(test3[j,4])
uniquemail[i,k+3] <- as.numeric(test3[j,5])
k <- k+4
print(paste(i,j,k))
}
}
Is there any way to do this. I used Sys.sleep, but don’t know how to use it for my motive above.
user6489260
source
share