#' Check whether R is running in an Rstudio session
#'
#' Based on \url{https://stackoverflow.com/q/12389158/1380598}.
#'
#' @export
isRstudio <- function() {
Sys.getenv("RSTUDIO") == 1 ||
.Platform$GUI == "RStudio" ||
if (suppressWarnings(requireNamespace("rstudioapi", quietly = TRUE))) {
rstudioapi::isAvailable()
} else {
FALSE
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.