dt

R Shiny set DataTable column width

不问归期 提交于 2019-11-27 04:21:34
I am trying to set the width of columns in a DataTable rendered in Shiny and am not able to implement it using the aoColumnDefs options. Has anyone tried this before ? My table has 1 text followed by 3 numeric columns. The numeric columns need to be narrower and the 1st column (text) wider. output$result <- renderDataTable({ z <- as(dataInput(), "data.frame") setnames(z, c("Rules", "Support", "Confidence", "StatDep")) z }, options = list(aLengthMenu = c(5, 30, 50), iDisplayLength = 5, bSortClasses = TRUE, aoColumnDefs = list(sWidth = "50px", aTargets = list(1)))) Thanks, Raj. ** Update ** This

Shrink DT::dataTableOutput Size

限于喜欢 提交于 2019-11-26 23:13:45
问题 I have a shiny interface, and I use DT::dataTableOutput and DT::renderDataTable a lot. However, I wonder if there's a way to shrink the datatable's size, e.g., making the font and the table smaller. How should I do this? Let's say I have the following code: foo <- function(){ shinyApp( ui = fluidPage( DT::dataTableOutput("table") ), server <- function(input, output) { x <- data.frame(1:5, 2:6) output$table <- DT::renderDataTable(x) } ) } What options or tags should I add? 回答1: Try adding

R Shiny selectedInput inside renderDataTable cells

谁说胖子不能爱 提交于 2019-11-26 17:07:46
问题 I search for solution to put selectedInputs in renderDataTable cells. I found js solutions: https://datatables.net/examples/api/form.html , however I do not know how to implement this solution in shinyjs as renderDataTable object. I would be grateful for hints / ideas / solutions how to implement editable renderDataTable in shiny. 回答1: Very similar to this: adding a column with TRUE/FALSE and showing that as a checkbox library(shiny) library(DT) runApp(list( ui = basicPage( h2('The mtcars