Search code examples
rapiloopslimit

Loop in R using API


I want to have a loop to retrieve data from this function listOMLRunEvaluations the function has a limit=10000. How can I make a loop in R to call this function either by task.id= i or by limit and offlimit (retrieve every 10000 rows in each iteration).


Solution

  • You could use a for loop with Sys.sleep() in case you also have a limit of request per second:

    result <- c()
    for(i in 1:10) {
    new <- listOMLRunEvaluations()
    result <- c(old, new)
    Sys.sleep(10)
    }