Query and manipulate HTML structures with tagQuery()
maintagQuery() to programmatically query and manipulate the underlying HTML structure of components. This is useful for fine-grained control over the DOM elements generated by R packages.repository·main·Indexed 42 days ago
https://github.com/rstudio/htmltoolsA toolkit for creating, manipulating, and writing HTML from R. It provides the foundation for generating custom HTML, CSS, and JavaScript, and includes functions like tagList() for arranging components, browsable() for viewing standalone webpages, and tagQuery() for programmatically querying and manipulating HTML structures.
tagQuery() to programmatically query and manipulate the underlying HTML structure of components. This is useful for fine-grained control over the DOM elements generated by R packages.You can install the stable release of htmltools from CRAN or install the development version directly from GitHub using remotes.
# Install stable release from CRAN
install.packages("htmltools")
# Install development version from GitHub
remotes::install_github("rstudio/htmltools")The {htmltools} package allows you to combine multiple HTML components (such as {htmlwidgets} like {plotly} graphs) into a single structure using tagList(). To view the resulting collection as a standalone HTML webpage, wrap the tagList() in the browsable() function.
library(htmltools)
library(plotly)
browsable(tagList(
plot_ly(diamonds, x = ~carat, height = 200),
plot_ly(diamonds, x = ~price, height = 200)
))