Questions tagged [htmltools]

htmltools is an R package that contains tools for generating HTML output directly from R.

htmltools provides R users with a means to generate HTML output such as tags and styles directly from R. It provides additional development tools such as dependency identification and tag attribute management. htmltools provides much of the underlying HTML functionality for other common packages like Shiny and rmarkdown.

This tag should be used in questions that directly reference the htmltools package and could also be useful for questions related to other packages (like Shiny and rmarkdown) when the post involves functionality imported into that package from htmltools.

72 questions
1
vote
0 answers

RMarkdown: Access objects made in html in later r chunk

If I have the following code to create a checkbox in an RMarkdown flex_dashboard, how do I access the variables created by the checkbox for later use in the code? --- title: "Temp Dashboard" author: "Me" output: flexdashboard::flex_dashboard: …
obewanjacobi
  • 458
  • 2
  • 12
1
vote
1 answer

Changing the footer of a Datatable in R using htmltools::withTags()

I am trying to change the footer of a Datatable in a Shiny App. I can replicate the error I get in the App with the following code: dt_test <- tibble(cntry = c("A","A","B"), city = c("X","Y","Z"), sales =…
der_emu
  • 13
  • 2
1
vote
1 answer

How to adjust row space in saved formattable table in R

With code below, I'm able to generate formattable table and save it as image: library(formattable) library(htmltools) library(webshot2) df <- data.frame( id = 1:10, name = c("Bob", "Ashley", "James", "David", "Jenny", "Hans", "Leo",…
ah bon
  • 9,293
  • 12
  • 65
  • 148
1
vote
1 answer

Changing table line borders to something similar to kable LaTeX

I have the following table and I would like to know if there is any way to change the table format in a way that the separator lines can not only be displayed horizontally, but as a cell grid just as in excel, or perhaps as in kable, kableExtra.…
JK Lambert
  • 333
  • 1
  • 6
1
vote
1 answer

R Shiny table how to format html code correctly in expandable rows

In my shiny app I display a table (reactable) with an expandable row. I would like to change the background color for certain words, therefor I use html spans. It works fine for the text in the regular row, in the expandable row however only the…
volfi
  • 435
  • 3
  • 11
1
vote
1 answer

Using for loops to generate html content

I am trying to generate html content using a for loop, but I am having problems in how the content looks in the html. Lets say I have a Rhtml template and I want to generate paragraphs in a for loop:
Bruno Guarita
  • 767
  • 10
  • 21
1
vote
0 answers

Installing htmltools in R gives me unable to load shared object libimf.so

When I try to install htmltools using this command: install.packages("htmltools") I get this error: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/gscratch/jayadevlab/packages/r/rlang/libs/rlang.so': libimf.so:…
kjrgreen
  • 11
  • 2
1
vote
1 answer

How to create an adaptative list (ul+li) using htmltools?

In the context of a Shiny application, I'm trying to display warnings thrown by some call as an HTML list. I could get all warnings as a character vector thanks to this answer, and I'm now actually building the HTML list. The easiest way I could…
Dan Chaltiel
  • 7,811
  • 5
  • 47
  • 92
1
vote
1 answer

HTML code generation for generated graphs in R

How to generate HTML code and assign it to a variable in R without saving it in an HTML file? (i.e) the function must be like p <- pairs(data) res <- htmlcodefunction(p) res output must be an HTML code not as a file
1
vote
0 answers

solution similar to include_graphics that works inside div

I'm trying to determine the best way to include png images inside multiple nested divs within R markdown. I would love to use knitr::include_graphics() but unfortunately it doesn't seem to work inside a div. for example... lets say I want to…
Zac Garland
  • 153
  • 7
1
vote
1 answer

Coercing plain HTML to shiny.tags

How do you convert a vector with plain HTML to a nested shiny tag list? Rep. Example library(shiny) library(htmltools) html_str <- '

Headline

Text

' Both htmltools::as.tags() and htmltools::tagList() don't seem to work.…
Comfort Eagle
  • 2,112
  • 2
  • 22
  • 44
0
votes
0 answers

Taglist for horizontal widget alignment in RStudio

I have three plotly plots as html widgets which I want to combine into one html. This one does the trick but I want the plots (fig_current, ...) to be saved horizontally after one another and scroll also horizontally and not vertically. How can I do…
math_ist
  • 69
  • 5
0
votes
1 answer

Shiny reactable list object in tags$button on click

So I have a situation where I would like to use an object in a tag$button(). This is to work around the fact that the columns may change. It works on the first click and then stops working and the whole table disappears on subsequent…
A-A-ron
  • 15
  • 6
0
votes
1 answer

How to load a local HTML file in R with htmltools?

I'm having a hard time loading a local HTML file. I tried with xml2 and it gives an empty file. With htmltools and its function includeHTML I get an error…
0
votes
1 answer

ggVennDiagram in lagList in R MarkDown

I am trying to embed Venn Diagrams to my report made in R MarkDown. I have dinamic number of graphs so I generate them by for loop. I know that R MarkDown has "problem" with loops but I find the way how to solve it when I want to plot plotly…
tomsu
  • 371
  • 2
  • 16