loop_test: Tries to run an expression a certain number of times

Description Usage Arguments Details

View source: R/upload.R

Description

This function executes test_expr to determine whether to enter a while loop. In the while loop, the control flow is as follows: sleep(sleep_before), thing_expr(), sleep(sleep_after).

Usage

1
2
loop_test(test_expr, test_fcn, thing_expr, n_lim = 15,
  warning_text = "", sleep_before = 0, sleep_after = 0)

Arguments

test_expr

a parameterless function that will be executed to determine while loop control flow

test_fcn

a function to evaluate the value of test_expr, with one parameter

thing_expr

the main task that must be completed by the end of the loop (no parameters)

n_lim

maximum number of iterations

warning_text

warning to print if iteration limit is reached

sleep_before

time to sleep before evaluating thing_expr

sleep_after

time to sleep after evaluating thing_expr and before evaluating test_expr at the end of the while loop

Details

The while loop will exit if test_fcn(test_expr) is false or if the number of iterations exceeds n_lim.


CSAFE-ISU/nbtrd documentation built on Dec. 28, 2020, 12:41 a.m.