Questions tagged [htmltools]
htmltools is an R package that contains tools for generating HTML output directly from R.
htmltools
82
questions
11
votes
4
answers
12k
views
How to store r ggplot graph as html code snippet
I am creating an html document by creating various objects with ggplotly() and htmltools functions like h3() and html(). Then I submit them as a list to htmltools::save_html() to create an html file.
...
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 ...
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 =...
7
votes
2
answers
4k
views
How to add title to a networkD3 visualisation when saving as a web page?
I have created a interactive visualisation using the following code:
library(networkD3)
nodes = data.frame("name" = c("node1", "node2","node3", "node4", "node5", "node6", "node7"))
links = as.data....
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
1
answer
4k
views
R: add title to networkD3 plot and save
I am interested in adding a title to a forceNetwork graph created with NetworkD3 and exporting the html with magrittr.
A solution was found in the R: HTML Tag Object help page in order to add a ...
3
votes
1
answer
1k
views
Set title of leaflet for R web page
I am using the R leaflet package to generate a map. When the web page is created, the <title> element of the web page is set to "leaflet":
<title>leaflet</title>
I would like to ...
3
votes
1
answer
3k
views
R Leaflet plot ship direction
I have information on the location of vessels/ships and the course they are steering. I'd like to plot them on a leaflet map with a custom icon which looks like a ship. I found the "tags" icon from ...
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 ...
3
votes
1
answer
445
views
Encode character to HTML in R, the CRAN way
Before voting for close as duplicate please ensure that it does actually answer my particular question here. Questions may look similar, but I haven't found an answer for mine. Thank you.
I am ...
3
votes
1
answer
504
views
How to to insert R (interactive or not) graphics in the tooltips of a ggiraph?
I'd like ultimately to insert R (interactive or not) graphics in the tooltips of a ggiraph.
Using an iframe as I successfully did before with leaflet, it would look like this:
library(ggplot2)
library(...
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....
3
votes
1
answer
417
views
How to display a SVG image in shiny
I would like to display in my web application an SVG image that I have hosted in the images folder. First I tried to display it with a tag but it didn't work:
ui <- fluidPage(
tags$img(src = &...
3
votes
1
answer
642
views
Shiny app as function, where to put www/ folder, CSS, JS
I am attempting to convert a relatively complex shiny app (3-4 modules, 8 CSS/JS files) into a package with one external function that builds an instance of an app for a given input (build_myApp(...