R/display.r
publish_mimebundle.Rdpublish_mimebundle calls the function stored as option value of jupyter.base_display_func,
clear_output calls the value of option jupyter.clear_output_func. (see: IRdisplay-options)
publish_mimebundle(data, metadata = NULL)
clear_output(wait = TRUE)A named list mapping mimetypes to content (character or raw vectors)
A named list mapping mimetypes to named lists of metadata, e.g. list('image/png' = list(width = 5))
Wait to clear the output until new output is available. Default TRUE.
If FALSE, clears the existing output immediately before the new output is displayed.
clear_output: Clear the output from the current cell.
if (FALSE) ## (Run inside of an IRkernel)
publish_mimebundle(list('text/html' = '<h1>Hi!</h1>'))
publish_mimebundle(
list('image/svg+xml' = '<svg xmlns="http://www.w3.org/2000/svg"><circle r="100"/></svg>'),
list('image/svg+xml' = list(width = 100, height = 100)))
#> Warning: IRdisplay can only be used from the IPython R kernel and R magic.
for (i in 1:5) {
Sys.sleep(.2) # simulate work
clear_output() # clear previous iteration
cat(i) # alternative: IRdisplay::display(i)
flush.console() # make output available
} # \dontrun{}
#> Warning: IRdisplay can only be used from the IPython R kernel and R magic.
#> 1
#> Warning: IRdisplay can only be used from the IPython R kernel and R magic.
#> 2
#> Warning: IRdisplay can only be used from the IPython R kernel and R magic.
#> 3
#> Warning: IRdisplay can only be used from the IPython R kernel and R magic.
#> 4
#> Warning: IRdisplay can only be used from the IPython R kernel and R magic.
#> 5