#' Visualize html document
#'
#' @export
#'
visualize <- function(h) {
if (interactive()) {
dir <- tempfile()
dir.create(dir)
html_file <- file.path(dir, "index.html")
enc <- stringi::stri_enc_detect(h)[[1]]$Encoding[1]
h <- iconv(h, from = "UTF-8", to = "ISO-8859-1")
cat(h, file = html_file)
rstudioapi::viewer(html_file)
}
}
#' Pipe operator
#'
#' See \code{\link[magrittr]{\%>\%}} for more details.
#'
#' @name %>%
#' @rdname pipe
#' @keywords internal
#' @export
#' @importFrom magrittr %>%
#' @usage lhs \%>\% rhs
NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.