Skip to contents

This function introduces a user specified random delay into a loop. Inspired by web scraping best practices.

Usage

q_delay(periods = c(1, 2))

Arguments

periods

Numeric vector with two values corresponding to the lower and upper bound of a uniform distribution from which the delay time is randomly sampled.

Examples

for (i in 1:10) {
  cat("Hello number", i, "\n")
  q_delay(periods = c(1, 2))
}
#> Hello number 1 
#> Error in q_delay(periods = c(1, 2)): could not find function "q_delay"