R/unix/startpb.R

Defines functions startpb

Documented in startpb

startpb <-
function(min=0, max=1)
{
    if (dopb()) {
        control <- getOption("pboptions")
        pb <- switch(control$type,
            timer = timerProgressBar(min = min, max = max,
                initial = control$initial,
                style = control$style, width = control$txt.width,
                char = control$char,
                min_time = control$min_time),
            txt = txtProgressBar(min = min, max = max,
                initial = control$initial,
                style = control$style, width = control$txt.width,
                char = control$char),
            tk = tcltk::tkProgressBar(min = min, max = max,
                initial = control$initial,
                title = control$title, label = control$label,
                width = control$gui.width))
        if (doshiny())
            pb <- shiny::Progress$new(min=min, max=max)
    } else {
        pb <- NULL
    }
    invisible(pb)
}

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.