R/pretend_working.R

Defines functions pretend_working

Documented in pretend_working

# Let's see if we can create some function that makes it look like we're working
# when we're not

pretend_working <- function(minutes = 5){
  library(rvest)
  start_time = Sys.time()

  # So we want some other functions here like a loading bar

  while(difftime(time1 = Sys.time(), time2 = start_time, units = "mins") < minutes){
    func <- sample(x = c("bar", "flashy", "wiki", "stack", "headlines", "message"), size = 1, prob = c(0.2, 0.2, 0.2, 0.1, 0.1, 0.2))

    switch(EXPR = func,
           bar = progress_bar(),
           flashy = flashy_bar(),
           wiki = rand_wiki(),
           stack = rand_stack(),
           message = buncha_messages(),
           headlines = headlines())

    cat("\n\n\n\n")

  }


}
svenhalvorson/SvenR documentation built on June 24, 2018, 9:25 a.m.