q_delay: Introduce Delay in Loop

View source: R/q_delay.R

q_delayR Documentation

Introduce Delay in Loop

Description

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))
}

AdlCruz/rctapi documentation built on Jan. 28, 2024, 8:15 p.m.