Description Usage Arguments Value Examples
Add attributes to a tag
1 | tag_attr(tag) <- value
|
tag |
add attributes to tag. |
value |
list with named attributes to add e.g. |
tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
img <- tempfile(fileext = ".png")
png(img)
plot(speed ~ dist, cars)
dev.off()
h <- html_html(html_body(
html_p("Display the 'cars' dataset as a table") +
html_table(cars) +
html_img(src = img, alt = "'cars' dataset") +
html_p(paste("Display the 'cars' dataset again, but now",
"with column sums in a 'tfoot' tag"),
style = "background-color: lightblue;") +
html_table(rbind(cars, colSums(cars)), tfoot = TRUE) +
html_p("Display the 'mtcars' dataset as a table",
style = "background-color: lightgreen;") +
html_table(mtcars) +
html_hr() +
html_p("Nice ☺")))
filename <- tempfile(fileext = ".html")
capture.output(h, file = filename)
browseURL(filename)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.