I would like to include icons in a datatable. This works fine for Shiny, see example below, but does not work without shiny.
library(shiny)
library(DT)
library(dplyr)
ui <- basicPage(
DT::dataTableOutput("table")
)
server <- function(input, output, session) {
output$table <- DT::renderDataTable({
data <- mtcars %>%
mutate(icon = as.character(icon("tag", lib = "glyphicon")))
datatable(data, escape = FALSE)
})
}
shinyApp(ui, server)
In this example using shiny the icons are shown:
library(DT)
library(dplyr)
data <- mtcars %>%
mutate(icon = as.character(icon("tag", lib = "glyphicon")))
datatable(data, escape = FALSE)
However, without Shiny there are no icons.