dt

RowGroup function not working when there are multiple datatable to be displayed

筅森魡賤 提交于 2020-03-25 18:03:32
问题 I have a requirement to show 2 datatables in 2 different tabs in a shiny application. One is a simple datatable whereas the other uses the rowgroup extension of DT package. When I'm using tabs to display both the datatables, the rowgroup function doesnt seem to work. library(shiny) library(DT) library(shinyjs) ui <- fluidPage( dashboardBody( fluidRow( tabBox(width = "100%", tabPanel("Table 1", fluidRow( column(12, withSpinner(DTOutput("my_table2",height="600px"))) ) ), tabPanel("Table 2",

Parent/Child Rows in R

陌路散爱 提交于 2020-03-17 03:06:03
问题 I'm trying to use some JavaScript to create a nice table layout with parents/child nesting. I only need one child per parent. I have two data frames. The goal here is to make a table that combines these two data frames. So far I am able to do that. However, the problem here is that I can only get the code to work for one row in df1. When I go to add in another row to df1 I get Error in data.frame: arguments imply differing number of rows: 1, 2 . For example, the desired result is achieved

Parent/Child Rows in R

做~自己de王妃 提交于 2020-03-17 03:05:33
问题 I'm trying to use some JavaScript to create a nice table layout with parents/child nesting. I only need one child per parent. I have two data frames. The goal here is to make a table that combines these two data frames. So far I am able to do that. However, the problem here is that I can only get the code to work for one row in df1. When I go to add in another row to df1 I get Error in data.frame: arguments imply differing number of rows: 1, 2 . For example, the desired result is achieved

Parent/Child Rows in R

有些话、适合烂在心里 提交于 2020-03-17 03:05:04
问题 I'm trying to use some JavaScript to create a nice table layout with parents/child nesting. I only need one child per parent. I have two data frames. The goal here is to make a table that combines these two data frames. So far I am able to do that. However, the problem here is that I can only get the code to work for one row in df1. When I go to add in another row to df1 I get Error in data.frame: arguments imply differing number of rows: 1, 2 . For example, the desired result is achieved

Single/multiple conditions for columns formating with DT

自作多情 提交于 2020-03-05 04:06:48
问题 This is related to the question in this Is there any similar approach to conditional formating for multiple columns from excel in Shiny,, the solution provided works fine but I am a bit stack in how to extend the code to meet new requirement. So if I have the following dataframe and want to change the background color of five columns based on the following condition: for columns X,Y if -4 < X < 4 and Y < 10 color of X,Y is pink elseif Y >10 color of X,Y is bleu else X ="" or Y="" then color

Merge columns in DT::datatable

牧云@^-^@ 提交于 2020-01-30 05:43:10
问题 I need to merge cells across columns in a DT::datatable in shiny. The best way seems to make use of the Javascript DataTables extension RowGroup. But I don't know which steps to take from viewing the page in above link, to having merged cells in my shiny app (there's a reason I'm working in shiny ;). There's a partial answer in the accepted answer to this stackoverflow question but 1) that was about merging rows (i.e. vertically in stead of horizontally), and 2) the mechanics behind the

Reduce Font Size of datatable in a Flexdashboard

最后都变了- 提交于 2020-01-25 23:39:09
问题 I'm working on a shiny flexdashboard, and one of the elements is a datatable with a lot of columns. Currently the columns are so many that they exceed the width of the app. Instead of adding a scroll bar I would prefer to simply reduce the font used in datatable so that each column will be smaller. Is this possible? 回答1: Found the answer. Needed to wrap renderDataTable in a div. div(renderDataTable(table()),style = "font-size:80%) 来源: https://stackoverflow.com/questions/46534677/reduce-font

object of type ‘closure’ is not subsettable in R Shiny

一个人想着一个人 提交于 2020-01-25 06:44:33
问题 I would like to add buttons to my DT (one for each row - in first column). When I click on the button it should remove the row from DT. I wrote a code: library(shiny) library(DT) shinyApp( ui <- fluidPage(DT::dataTableOutput("data")), server <- function(input, output) { values <- reactiveValues(data = NULL) values$data <- as.data.frame( cbind(c("a", "d", "b", "c", "e", "f"), c(1463, 159, 54, 52, 52, 220), c(0.7315, 0.0795, 0.027, 0.026, 0.026, 0.11) ) ) shinyInput <- function(FUN, len, id, ..

How to replaceData in DT rendered in R shiny using the datatable function

若如初见. 提交于 2020-01-24 22:16:45
问题 I have an R shiny app with a DT datatable that is rendered using the datatable function in order to set various options. I would like to use dataTableProxy and replaceData to update the data in the table, but all the examples I can find assume the DT is rendered directly from the data object, not using the datatable function. The reprex below shows what I would like to do, but replaceData doesn't work in this pattern. How do I do this? Thanks. # based on # https://community.rstudio.com/t

Display Image in a Data Table from a local path in R Shiny

一世执手 提交于 2020-01-24 15:31:45
问题 I am trying to display the Image in a Data Table from a local path . Please note the local path is different from www folder and in real scenario, I can not move the images from the prescribed path to www folder. Strange thing is that it is working from www location and but not from the prescribed path. Looking for any tips to resolve this. Here is the code: library(shiny) library(shinyBS) library(DT) flag <- data.frame(image=c('<img src="C:/Users/string/100x100/100x100_bigimg.jpg"></img>'))