Questions tagged [htmltools]
htmltools is an R package that contains tools for generating HTML output directly from R.
htmltools
82
questions
1
vote
0
answers
179
views
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/...
2
votes
1
answer
531
views
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 ...
3
votes
1
answer
843
views
Including external markdown file covering inline code through includeMarkdown
I would like to include external markdown file covering inline code as well. Once I hit the Knit on RStudio, it does show only code text rather than the actual value of sys.time. If I place the ...
1
vote
1
answer
199
views
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 ...
3
votes
1
answer
2k
views
R code to save shiny.tag.list to html as the viewer->export->save as web page button does
I have a leaflet map that I have modified to have a special CSS for popups following the suggestions here. Now I want to save the result as an HTML web page. The resulting object is of type shiny.tag....
1
vote
0
answers
137
views
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 ...
2
votes
1
answer
416
views
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 <- '<div><h1>Headline</h1><p>Text</p>...
10
votes
2
answers
1k
views
R: How to elegantly separate code logic from UI / html-tags?
Problem
When dynamically creating ui-elements (shiny.tag, shiny.tag.list, ...), I often find it difficult to separate it from my code logic and usually end up with a convoluted mess of nested tags$...
9
votes
3
answers
21k
views
Text to be written must be a length-one character vector
After installing the new version of shiny (1.4.0) package, I face a strange error message
> Warning: Error in writeImpl: Text to be written must be a length-one
> character vector [No stack ...
2
votes
1
answer
236
views
Apply a recursive function to a nested list while preserving the classes of sublists
I have a nested list called inputs:
library(htmltools)
library(shiny)
inputs = tagList(
selectInput('first', 'FIRST', letters),
checkboxInput('second', 'SECOND')
)
str(inputs, max.level = 1)
...
8
votes
1
answer
2k
views
Clicking a leaflet marker takes you to URL
Within the leaflet package for R, is there a way to click on a marker, and be directed to a URL?*
Here's the JS solution.
In R, to add a Popup with a URL:
library(leaflet)
content <- paste(sep =...
0
votes
1
answer
982
views
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 ...
3
votes
1
answer
210
views
Add or update attribute to an element and all sub-elements
I'm working on a full page layout using fillPage(). For a box to be able to stretch vertically, all elements that define this box need to have a style = "height: 100%" attribute (or so I'm told). Is ...
7
votes
1
answer
3k
views
DT Shiny different custom column header by column
my css skills are extremely limited but assuming the following example:
sketch = htmltools::withTags(table(
class = 'display',
thead(
tr(
th(rowspan = 2, 'Species'),
...
3
votes
0
answers
280
views
Add new line spaces between elements of an htmltools::tagList in an Rmarkdown html page
I using htmltools::tagList to display a list of plots in an Rmarkdown html page.
Let's say my list of plots is:
set.seed(1)
plot.list <- lapply(1:3,
function(i) plotly::...