browseFile | R Documentation |
RStudio overrides the default behaviour of browseURL on some platforms, meaning that local files are not opened as file:///...
URLs but as http://localhost...
. This can break some local HTML files that are expecting to be served as file:///
URLs.
browseFile(url, browser = getOption("browser"), encodeIfNeeded = FALSE)
url |
string: as for |
browser |
string: as for |
encodeIfNeeded |
logical: as for |
myfile <- tempfile(fileext = ".html")
cat("<h1>Hello!</h1>", file = myfile)
## in RStudio on Linux, this will be opened as a http://localhost URL
if (interactive()) browseURL(myfile)
## but this shouldn't
browseFile(myfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.