timed {ao}R Documentation

Interruption of long evaluations.

Description

This function evaluates expr and interrupts the evaluation after secs seconds.

Usage

timed(expr, secs)

Arguments

expr

An R expression to evaluate.

secs

The number of seconds.

Details

This function is a wrapper for withTimeout.

Value

Either the value of expr or NULL if the evaluation time exceeded secs seconds.

Examples

timed(Sys.sleep(1.1), 1)

[Package ao version 0.2.1 Index]