R/unix/setpb.R

Defines functions setpb

Documented in setpb

setpb <-
function(pb, value)
{
    if (dopb()) {
        control <- getOption("pboptions")
        rval <- switch(control$type,
            timer = setTxtProgressBar(pb, value),
            txt = setTxtProgressBar(pb, value),
            tk = tcltk::setTkProgressBar(pb, value, label = control$label))
        if (doshiny())
            rval <- pb$set(value,
                message = if (control$title == "") NULL else control$title,
                detail = if (control$label == "") NULL else control$label)
    } else {
        rval <- NULL
    }
    invisible(rval)
}

Try the pbapply package in your browser

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

pbapply documentation built on July 9, 2023, 7:41 p.m.