Nothing
#' Writes the HTML code to a file
#'
#' \code{write_tableHTML} will write the HTML code to a file
#'
#' \code{write_tableHTML} will write the HTML code to a file.
#'
#' @param tableHTML A tableHTML object created by the tableHTML function.
#'
#' @param file A character string. This is the file name. You need to include the extention.
#'
#' @param complete_html Either TRUE or FALSE. Defaults to FALSE. If TRUE then the <html> and <body>
#' tags are also added in the file.
#'
#' @return The function itself returns nothing but a file is created.
#'
#' @examples
#' \dontrun{
#' write_tableHTML(tableHTML(mtcars), file = 'myhtmlcode.html')
#'
#' write_tableHTML(tableHTML(mtcars), file = 'myhtmlcode.html', complete_html = TRUE)
#' }
#'
#' @export
write_tableHTML <- function(tableHTML, file, complete_html = FALSE) {
#checks
if (!inherits(tableHTML, 'tableHTML')) stop('tableHTML needs to be a tableHTML object')
#create style
if (complete_html) {
tableHTML <- htmltools::HTML(paste('<!DOCTYPE html>\n<html>\n<body>',
tableHTML,
'</body>\n</html>',
sep = '\n'))
}
cat(tableHTML, file = file)
invisible(NULL)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.