I want to print a text in a window with using a loop such as the following one
texts <- c("a", "ab", "abd")
for (t in texts) {
cat(t, "\n")
Sys.sleep(1.5) # The real transition time is around 0.05 second
}
Do I have to resort to Shiny? How to do it?
vcat <- function(...) {
require(htmltools)
html_print(pre(paste0(capture.output(cat(...)), collapse="\n")))
}
texts <- c("a", "ab", "abd")
for (t in texts) {
vcat(t, "\n")
Sys.sleep(1.5)
}
Code taken from this answer