Skip to main content

Questions tagged [htmltools]

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

0 votes
0 answers
27 views

How to have a ReactShinyInput inside a ReactShinyWidget?

I have just started playing with the reactR package in the hope of having React elements usable with Shiny R. I have got project with the scaffoldReactWidget function setup and working quite nicely so ...
Pavel Khokhlov's user avatar
0 votes
1 answer
31 views

appendContent can't be used in a Shiny render call

The funciton addSearchGoogle from leaflet.extras is throwing this error in a Shiny-app: Warning in renderWidget(instance) : Ignoring appended content; appendContent can't be used in a Shiny render ...
SeGa's user avatar
  • 9,719
0 votes
1 answer
51 views

Saving svg generated in shiny

I am trying to save an .svg that I generate inside a shiny app using htmltools (MRE below). This requires adding the svg namespace to the svg tag with xmlns:xlink="http://www.w3.org/1999/xlink&...
smartse's user avatar
  • 1,295
0 votes
1 answer
69 views

How to write/share an html document created in R using crosstalk and leaflet

I've created a filterable map using crosstalk and leaflet in R, and I'd like to share this with coworkers as a standalone document: library(leaflet) library(htmltools) library(htmlwidgets) #example ...
Eric's user avatar
  • 1
0 votes
1 answer
51 views

Print single charts via loop with highcharter in rmarkdown

I would like to print single charts created in a for loop as tabbed content using the packages rmarkdown and highcharter. So far i have only succeeded in displaying all the graphics in one tab. The ...
user avatar
1 vote
1 answer
88 views

Why my Html function in R is not working:?

This is my code: card_function <- function(title,paragraph,tags){ div( class = "card", div(class = "header"), div( class = "info", p(class = &...
JohnBones JohnBones's user avatar
0 votes
0 answers
879 views

Updated htmltools doesn't install anyway

In Rmarkdown my problem is Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace 'htmltools' 0.5.6 is already loaded, but >= 0.5.7 is required Calls: ... ...
Tofa Ahammed's user avatar
1 vote
1 answer
54 views

Grandchildren elements are not rendered, using R htmltools::tagList to generate HTML for paged pdf

I am trying to create a paged pdf report in R, using pagedown together with htmltools::tagList. Each page in the report is supposed to bring together field survey results, mainly images ande tables, ...
v.eriksson's user avatar
1 vote
2 answers
89 views

Insert image (file or R object) into existing html file from R script

I include two ggplotly() graphics in a html file, eg. library(ggplot2) library(plotly) library(htmltools) g1 <- ggplot(data=data.frame(x=1:10, y=1:10)) + geom_point(aes(x=x, y=y)) g2 <- ...
user2955884's user avatar
0 votes
1 answer
179 views

R Shiny Add Icon To tag$button

I'm trying to render a table in R Shiny that has a name, file, or url with a download button column that opens a new tab based on the data in the row. I'm unable to have the htmltools tag show an icon ...
Curtis's user avatar
  • 181
1 vote
0 answers
175 views

How can I correctly resize all plotly plots encapsulated in a javascript tab?

I am new to handling html objects from R and I am having an issue while trying to create html tabs from named lists (the target document is html pages obtained from RMarkdown). Long story short, while ...
MiddleC's user avatar
  • 11
0 votes
1 answer
78 views

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 ...
A-A-ron's user avatar
  • 27
0 votes
1 answer
128 views

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 message. library(htmltools) rawHTML<-...
laurent_grouet's user avatar
0 votes
1 answer
126 views

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 ...
tomsu's user avatar
  • 375
1 vote
2 answers
121 views

Subscript in R DT's footer with withTags()

I'm trying to add a superscript to a DataTables footer in a Shiny app (similar as here to the rownames/body). library(shiny) library(DT) ui <- fluidPage(dataTableOutput("table")) server ...
bathyscapher's user avatar
  • 2,079
0 votes
1 answer
331 views

How to evaluate a list of cards in bslib::layout_column_wrap?

I am trying to display a list of cards in a 2d grid using the function bslib::layout_column_wrap(). However, I get a 1d grid with the cards positioned in one column instead of multiple columns. See a ...
Gion Mors's user avatar
  • 295
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 = &...
Wardiam's user avatar
  • 177
0 votes
1 answer
234 views

Can't seem to install the "devtools" package

I need to install Devtools so i can download the 0.5.4 htmltools package from github, almost every package i try to install gives an error stating that the htmltools version i have is 0.5.2 but the ...
Rafael Novaes's user avatar
0 votes
1 answer
221 views

R - markdown how to print list of dataframes to "Tabbed sections"

According bookdown documentation in 3.3, there is functionality to hide chunks in to the tabs. https://bookdown.org/yihui/rmarkdown/html-document.html I occasionally use it, but I can't figure out how ...
prdel99's user avatar
  • 331
0 votes
0 answers
159 views

How to link to CSS with htmltools?

I understand htmltools can be used to link to a JavaScript file: htmltools::tags$script(src = "https://unpkg.com/mapbox-gl-leaflet/leaflet-mapbox-gl.js") But how would I link to a CSS file, ...
DiamondJoe12's user avatar
  • 1,701
0 votes
1 answer
365 views

How do I attach a CSS dependency to my Shiny app with htmlDependency() and tagList() from htmltools

I'm trying to attach a custom css stylesheet to style my shiny app. However I haven't had much success. I know that there is many ways to do it, but according to chapter 4 of Outstanding UI with Shiny ...
data_science_newbie's user avatar
1 vote
1 answer
576 views

How to add an icon in front of specific column name of reactable

R Gurus, I am struggling with a unique problem with adding an icon in front of certain column names in a reactable. library(htmltools) library(dplyr) library(tippy) data <- as_tibble(mtcars[1:6, ],...
M.Qasim's user avatar
  • 1,867
0 votes
0 answers
434 views

reduce file size of exported leaflet html by linking several layers to the same data (json) instead of keeping the information separately

Generating leaflet html's easily results in a 50-75 MB file (depending on the number of layers). However, they can be zipped to reduce the file size by factors. So i guess there is lots of repetitive ...
Beni's user avatar
  • 251
0 votes
1 answer
294 views

How to generate simple html table using Shiny and R without using renderTable function?

I'm really new to R/Shiny, I'm working on a project and I'm having a problem. Indeed, according to what I learned on the documentation, the renderTable function makes it possible to generate a ...
armel sauvy's user avatar
1 vote
1 answer
301 views

Shiny Leaflet Slow with HTML Labels

I'm building a shiny app with a leaflet map that updates based on user selection. When I got to working on the labels for shiny, I noticed my performance dropped upon hitting my action button to ...
Spruce's user avatar
  • 13
0 votes
1 answer
398 views

Change column header color

I have a Shiny app that displays a DT table. I would like to be able to change the color of the column headers (not the column header text color) from black to something else say #34a8eb. I tried the ...
Ed_Gravy's user avatar
  • 1,995
1 vote
0 answers
87 views

Add dependencies of shinydashboardplus in shiny

Below is the code for shiny app that I am using. shiny::shinyApp(fluidPage( # Give the page a title titlePanel("Telephones by region"), # Generate a row with a sidebar ...
Williams86's user avatar
2 votes
1 answer
299 views

How to use htmltools::attachDependencies?

Here is an example of how I "manually" add a HTML dependency to a datatable. This works fine. When I try with attachDependencies, the dependency is not attached. library(DT) library(...
Stéphane Laurent's user avatar
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(...
doana's user avatar
  • 65
1 vote
1 answer
405 views

Print HTML formatted text in Jupyter with R from the list of citations of loaded packages

I have a R variable containing some html content inside, for exemple : myvar = "<h3>Section Title</h3>" I would like to print it not as <h3>Section Title</h3> but as ...
vinalti's user avatar
  • 1,144
1 vote
1 answer
1k views

How to align and draw borders on complex header for datatable in R shiny?

I am using the container to create the header using the example from here. I am looking to center align the 'Overall' and 'In-patient' header. I tried adding the align = 'left' parameter in th ...
sutsabs's user avatar
  • 455
0 votes
1 answer
38 views

How do I put a GLSL script into an `htmlDependency()`?

The htmltools::htmlDependency function allows me to set Javascript and CSS files as a dependency of a tag. This means I can have tags on a page that use the code without including multiple copies of ...
user2554330's user avatar
0 votes
1 answer
78 views

Boostrap Buttons Wrapping when they shouldn't be

I can't see why the Search and Clear Buttons wrap onto the following line after Postcode. I've used the last example from the Button Addons code from here. https://getbootstrap.com/docs/4.0/...
Chris's user avatar
  • 1,503
0 votes
0 answers
612 views

Looking for a pretty way to create expandable rows for columns with a lot of text

I was hoping to make a table that has expandable rows that may stay open when toggled. I wanted to put the columns with long amounts of text as expandable row details. The problem is when I use "...
s.libes's user avatar
  • 59
2 votes
1 answer
1k views

How to style reactable cell background with custom grouping select

I have some data I'm trying to present using reactable. I am styling the background of cells based on the value. There are a number of groups in the data which are useful, but the groups themselves do ...
TrainingPizza's user avatar
3 votes
0 answers
436 views

change size of plots in htmltools::taglist R markdown

I am trying to use a loop in Rmarkdown that prints a leaflet map and plotly graph side by side (the loop iterates through vegetation types). I am having trouble getting the side-by-side to have the ...
kingmidaz's user avatar
0 votes
0 answers
26 views

Package installation issue with R version 3.6.0 [duplicate]

I have R 3.6.0 (and I'm currently obliged to use this version of R) and I'm facing the following problem. My goal is to install the 'shiny' package. I run install.packages("shiny",checkBuilt=...
Angelo's user avatar
  • 1,720
0 votes
0 answers
32 views

how to direct to the link via .tabsetpill

I would like to direct to the relevant link when I click on the .tabsetpill is there any way to get around this? Many thanks in advance. --- title: "" output: html_document --- # ...
Seyma Kalay's user avatar
  • 2,763
1 vote
0 answers
83 views

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" ...
obewanjacobi's user avatar
2 votes
0 answers
446 views

Add an interactive Check Box to a Flexdashboard in R

I'm building a flexdashboard out in an RMarkdown document, but I've run into issues with interactivity. So I've gotten a solution in shiny up and running, but the issue is that at my place of work we ...
obewanjacobi's user avatar
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(...
jatkins23's user avatar
0 votes
2 answers
397 views

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: <body ...
boris's user avatar
  • 13
1 vote
1 answer
577 views

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&...
der_emu's user avatar
  • 23
0 votes
1 answer
679 views

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 ...
werN's user avatar
  • 129
1 vote
1 answer
344 views

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", &...
ah bon's user avatar
  • 9,851
1 vote
1 answer
447 views

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 ...
JK Lambert's user avatar
0 votes
2 answers
308 views

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 ...
WannabeSmith's user avatar
0 votes
1 answer
249 views

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 ...
ixodid's user avatar
  • 2,310
1 vote
1 answer
804 views

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 ...
volfi's user avatar
  • 457
2 votes
0 answers
955 views

Package ‘htmltools’ version 0.5.0 cannot be unloaded

I am trying to launch a RShiny App but each time i get this message error: Package ‘htmltools’ version 0.5.0 cannot be unloaded: Error in unloadNamespace(package) : l'espace de noms ‘htmltools’ est ...
Sophie Cvl's user avatar

15 30 50 per page