| render | R Documentation |
Converts a hypertext.tag object (and all its descendants) into an HTML
string. Text children are escaped; nested hypertext.tag children are
rendered recursively.
render(x, ...)
## S3 method for class 'hypertext.tag'
render(x, file = "", write_mode = c("overwrite", "append"), ...)
## Default S3 method:
render(x, file = "", write_mode = c("overwrite", "append"), ...)
## S3 method for class 'hypertext.raw'
render(x, file = "", write_mode = c("overwrite", "append"), ...)
## S3 method for class 'list'
render(x, file = "", write_mode = c("overwrite", "append"), ...)
x |
|
... |
Further arguments passed from or to other methods. |
file |
String /// Optional. Path to file to print to. |
write_mode |
String /// Optional.
Either "overwrite" (default) which overwrites the contents
of |
When file is provided, the rendered HTML is written to the specified
file via cat() and the HTML string is returned
invisibly.
A single character string of HTML.
page <- tags$html(
tags$head(
tags$title("Home")
),
tags$body(
tags$h1("Welcome")
)
)
# return HTML as a string:
render(page)
## Not run:
# write to a file:
render(page, file = "index.html")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.