if (FALSE) {
# run an application inside the IDE
rstudioapi::viewer("http://localhost:8100")
# run an application and request a height of 500 pixels
rstudioapi::viewer("http://localhost:8100", height = 500)
# use 'viewer' option if set, or `utils::browseURL()` if unset
viewer <- getOption("viewer", default = utils::browseURL)
viewer("http://localhost:8100")
# generate a temporary html file and display it
dir <- tempfile()
dir.create(dir)
htmlFile <- file.path(dir, "index.html")
# (code to write some content to the file)
rstudioapi::viewer(htmlFile)
}
Run the code above in your browser using DataLab