I am trying to achieve something like this:
I was wondering if this is something that can be achieved with renderTable
and some CSS
/HTML
, but I wasn’t able to come anywhere close to achieving this. Here’s a reprex:
ui.R
:
library(shiny)
library(DT)
ui <- fluidPage(
fluidRow(
column(6,
tableOutput("horizontalBarTable"))))
server.R
:
server <- function(input, output) {
data <- data.frame(
Category = c("Category A", "Category B", "Category C"),
Percentage = c(30, 50, 70)
)
output$horizontalBarTable <- renderTable({
data
}, sanitize.text.function = function(x) x, include.rownames = FALSE) }
2
Answers
DT package might help you with this.
Here is a solution :
Here is an adaptation of the app of the link given in a comment: