dt

R Using JavaScript to customize DT tables

自古美人都是妖i 提交于 2019-12-11 18:46:01
问题 I have previously asked how to colour cells based on colours stored in hidden columns (link) and how to get information when hovering a cell (link). I would also like to do some formatting at the same time. I want to expand my initial posts where I want to add colour depending on colour specified in the data frame add the hover option to display the sample sizes related to the individual cells (also in the data frame). apply number formatting to specified columns Example data: dat <- iris[1:5

How to edit a table using DT and Shiny from an uploaded file?

我们两清 提交于 2019-12-11 17:56:40
问题 I am relying on the code chunk found here to create a Shiny app to upload a table, edit the table, then download the table. I have managed to edit a table that is already loaded in memory (iris) but how do I edit a table that is to be uploaded in Shiny? . I have tried the code in the link above and verified that it works. I have also tried the code below and this works too. What I have not been able to achieve is to convert the data frame x into a reactive object that is assigned to an

SliderInput issue with table in R shiny

风格不统一 提交于 2019-12-11 17:30:32
问题 Upon running this script, I create a DT table with two columns "Customers_one" and "Customers_two", a selectInput and SliderInput in R shiny. I select a name from selecInput which is in the first column too and compare it with the second column and give percentage similarity between the two in the third column. My issue is that, in the last two # statements in server code, I am trying to make the table such that when slider points at a value say "75", I get rows only with similarity greater

R Shiny - Select extension for DataTables - getting selected rows and preselecting rows

╄→尐↘猪︶ㄣ 提交于 2019-12-11 15:51:51
问题 The app below has a modal that displays a DT when opened. For the DT, row selection is enabled and I am using the Select extension for DataTables instead of the DT package's implementation of row selection. The modal has two buttons Apply and Cancel . When the user clicks Apply , the indices of any rows that they may have selected are stored in a reactive value rv$selected_rows via rv$selected_rows = input$table_rows_selected and the modal is dismissed. When the user clicks Cancel , any

download edited data table gives warning in shiny app

时光毁灭记忆、已成空白 提交于 2019-12-11 15:36:52
问题 Here is an example shiny app that allows user to download editable table. User can click on the csv button on the upper left corner to download the table. However, I found after I edit any cell in the table (by double click on any cell and modify contents), when I click on the csv button, enter file name and save, I got warning message like below: dataTables warning: table id=DataTables_Table_3 - invalid json response. For more information about this error, please see http://datatables.net/tn

download button disappear after editing data table in shiny app

蹲街弑〆低调 提交于 2019-12-11 14:29:54
问题 I have included editable table in my shiny app I developed in my organization. Use this simple example to illustrate the issue. This is an extension of this question In this app, after I edit any cell, the download button just disappear. Does anyone know why that happens? Thanks a lot in advance. library(shiny) library(DT) library(dplyr) # UI ui = fluidPage( selectInput("nrows", "select n entries", choices = 100:150, selected = 100, multiple = FALSE), downloadButton("download1", "Download

Subset a dataframe based on plotly click event

本小妞迷上赌 提交于 2019-12-11 14:25:36
问题 I have the data frame below: Name<-c("John","Bob","Jack") Number<-c(3,3,5) NN<-data.frame(Name,Number) And a simple shiny app which creates a plotly histogram out of it. My goal is to click on a bar of the histogram and display the Name in a datatable that correspond to this bar. For example if I click on the first bar which is 3 I will take a table with John and Bob names. library(plotly) library(shiny) library(DT) ui <- fluidPage( mainPanel( plotlyOutput("heat") ), DT::dataTableOutput('tbl4

R shiny DT strange rendering issue

我只是一个虾纸丫 提交于 2019-12-11 13:51:58
问题 I'm having a strange issue with one of my applications using DT. I'm trying to render a table with renderDataTable with all column names have mouse over text. Here is the code: server.R .libPaths("/usr/lib64/R/library") library(shiny) # 0.12.1 library(data.table) # 1.9.4 library(DT) # 0.1 options(DT.options = list(pageLength = 5,lengthMenu = c(5,10, 25, 100),orderClasses=TRUE)) rb <- fread("r1.csv") ## r1.csv has the following data(subset) : # "c1","c2","c3","c4" # "10011","7","999999","3" #

download button disappear when deselecting column or editing data table in shiny app

夙愿已清 提交于 2019-12-11 10:59:29
问题 I built a shiny app for downloading customized and editable data table. Here I use iris dataset as an example. According to this post, I add a button to download the whole dataset as csv. However, one issue came up. When I tried to uncheck some column OR edit table, the download button simply disappear. And it never show up again. I spend hours trying to figure it out but was unsuccessful. Does anyone know why that happens? Thanks a lot in advance. library(shiny) library(DT) library(dplyr) #

How to ensure row coloring updates when R Shiny DT datatable is sorted/filtered?

為{幸葍}努か 提交于 2019-12-11 10:17:11
问题 I am writing an R Shiny app. I use at DT datatable with specific colors for text entries. When the table is resorted the colors do not stay with their correct rows. Instead they stay in place. I assume that I need to observe and react to the event of the table being reordered/filtered. How do I do that? Sample code below. library(shiny) library(DT) ui= shinyUI(fluidPage( titlePanel("Test reorder DT datatave"), sidebarLayout( actionButton("button does nothing", "nothing") , mainPanel( DT: