util_setup_rstudio_job: Set up an RStudio job

View source: R/util_setup_rstudio_job.R

util_setup_rstudio_jobR Documentation

Set up an RStudio job

Description

Also defines a progress function and a progress_msg function in the caller's environment.

Usage

util_setup_rstudio_job(job_name = "Job")

Arguments

job_name

a name for the job

Details

In RStudio its job system will be used, for shiny::withProgress based calls, this will require min and max being set to 0 and 1 (defaults). If cli is available, it will be used, in all other cases, just messages will be created.

Value

list: the progress function and the progress_msg function

Examples

## Not run: 
  test <- function() {
    util_setup_rstudio_job("xx")
    Sys.sleep(5)
    progress(50)
    progress_msg("halfway through")
    Sys.sleep(5)
    progress(100)
    Sys.sleep(1)
  }
  test()

## End(Not run)

dataquieR documentation built on July 26, 2023, 6:10 p.m.