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
0
votes
2 answers

htmlwidgets::saveWidget produces html file with default style="padding: 40px"

By default, the html document created by the htmlwidgets::saveWidget which use htmltools (for example, htmlwidgets::saveWidget (reactable(iris))) has the following attributes in the body tag: css
boris
  • 13
  • 5
0
votes
1 answer

R Shiny: How to change the color of a button depending on the value of a checkbox with tagQuery()?

I want to change the css class of a bootstrap button depending on the value of a checkbox. If the value of the checkbox (input$x) is checked ie. euqals TRUE, i want to add a class and when the value is false i want to remove the class. The Code…
werN
  • 109
  • 7
0
votes
2 answers

header style not working when putting a button in the header of shinydashboard

I managed to put an action button in the shiny dashboard's header. However, when applying styling using tags$li, it only applies to the sidebar. When removing the tags$a portion, the styling gets applied throughout the header. Not sure how to fix…
WannabeSmith
  • 435
  • 4
  • 18
0
votes
1 answer

How to save diffObj as HTML that's readable by a browser?

The code below compares two vectors and creates the difference, diff_content, formatted as "HTML". Typing diff_content in RStudio's Console brings up this table in the Viewer: However, when I save diff_content with save_html and then try to open…
ixodid
  • 2,180
  • 1
  • 19
  • 46
0
votes
2 answers

R Obtaining a self-contained html file for tag list

I hope somebody can help me with this. I have a package that uses htmltools and reactable to produce html reports for some operations, for example: columns_def <- list( ProjectID = reactable::colDef( align = "right", style =…
0
votes
2 answers

How to perform looping and iteration of a script in R?

I am running an R script to analyze some biological data. Example of the snippet data and script is provided below. This data file has many columns (but I would like to focus on 5th column- Gene). I have more than 100 data files like this (consider…
0
votes
1 answer

render grouped list in HTML

I am trying to make an HTML detailed elements by group (grouped or nested). The function div_detail_each format one row and stored as shiny.tag class. After that, I nest by group and unify the tags with unify_divs. I make a tiny example with mtcars.…
Captain Tyler
  • 500
  • 7
  • 19
0
votes
1 answer

Generate html code using lapply() with multiple arguments

I am trying to generate several html paragraphs in a loop using lapply(). These paragraphs are in a data.frame and the data.frame have more columns with details for the paragraphs (class, id, etc). I was able to produce the loop with only one…
Bruno Guarita
  • 767
  • 10
  • 21
0
votes
2 answers

How to avoid Error in load Namespace using R

Am trying to launch a shiny app using the below command. Rscript -e "shiny::runApp('test-app', launch.browser=TRUE)" However, I get an error as shown below Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace…
The Great
  • 7,215
  • 7
  • 40
  • 128
0
votes
1 answer

Replacing the attribute value of an htmltools::tag

Say I have the following tag: library(htmltools) t = div(name = 'oldname') I can overwrite the 'name' attribute of this tag using t$attribs$name = 'newname' but prefer using htmltools getters/setters, does the package have a function that…
user51462
  • 1,658
  • 2
  • 13
  • 41
0
votes
1 answer

R Shiny & htmltools - Extracting a tag by name

I have a tagList of two Shiny inputs, inputs. I would like to extract the label tag for each input. I was hoping that htmltools had a getter function to achieve this but in the absence of one I've defined a function, getLabel, that recurses through…
user51462
  • 1,658
  • 2
  • 13
  • 41
0
votes
2 answers

How to use tags with special characters in htmltools inside rmarkdown document?

In a rmarkdown document, how may I use HTML special characters inside a tag with htmltools package? If we write in a r chunk of a rmarkdown document something like this htmltools::tags$th("μ") we get: &mu; instead of μ
Leonardo Motta
  • 101
  • 1
  • 5
1 2 3 4
5