R/wait.R

Defines functions waitclick wait

Documented in wait waitclick

##' Wait for user input (keyboard or mouse)
##'
##' @title Wait for user input (keyboard or mouse)
##' @aliases waitclick
##' @author Klaus K. Holst
##' @export
##' @keywords iplot
wait <- function() {
    cat(gettext("\nPress <Enter> to continue..."))
    res <- try(scan("", what=0, quiet=TRUE, nlines=1), silent=TRUE)
}
waitclick <- function() if(is.null(locator(1))) invisible(NULL)

Try the lava package in your browser

Any scripts or data that you put into this service are public.

lava documentation built on Nov. 5, 2023, 1:10 a.m.