dt

render dropdown for single column in DT shiny BUT loaded only on cell click and with replaceData()

别来无恙 提交于 2020-08-08 03:52:45
问题 Goal To have select dropdown in DT datatables not at the building of the datatable but built on cell click, with replaceData() and with the datas on RDBMS (SQL Server). When I click on the selected option of the , for example Ohio I want to set my data (and the RDBMS) with the id 2 . The issue With replaceData() the events of select are unbinded. It strange because only the cells where I've clicked are unbinded. the selected page is lost Update of StateId works (but I cannot click again on if

Limit row selection in DT Table in Shiny

血红的双手。 提交于 2020-08-08 03:45:51
问题 I am currently trying to limit my selection in a DataTable in Shiny to just two rows - I want the table to not allow the user to click on more than rows (but also to have the ability to deselect them afterwards). library(DT) shinyApp( ui = fluidPage( fluidRow( column(12, dataTableOutput('table') ) ) ), server = function(input, output) { output$table <- DT::renderDataTable(iris, options = list(selection = "multiple") ) } ) The row selection is currently on multiple mode, which works, but I don

Edit datatable in Shiny with dropdown selection for factor variables

半腔热情 提交于 2020-07-18 10:24:08
问题 I am trying to create a Shiny app that allows users to edit a datatable, whereby the edits are saved. Here is a minimal example: library(shiny) library(DT) ui <- fluidPage( DT::DTOutput('df') ) server <- function(session, input, output){ df <- data.frame(x = factor(c("A", "B", "C"), levels = c("A", "B", "C"))) output$df <- DT::renderDT(df, editable = T) proxy <- dataTableProxy("df") observeEvent(input$df_cell_edit, { info <- input$df_cell_edit str(info) i <- info$row j <- info$col v <- info

How to create a dropdown list in a Shiny table using datatable when editing the table?

匆匆过客 提交于 2020-07-14 07:04:50
问题 I used RStudio to read in a csv file and used Shiny to build an app as an interactive table, the cell I selected right now as shown in the picture is pre-filled. enter image description here I want to change the value given pre-defined options in a dropdown list, such as, "Keep Dataset", "Pass", etc., I searched hundreds of materials and I literally ran out of my bullets...... PLEASE HELP! 回答1: We can do that with the JavaScript library CellEdit. Download the file dataTables.cellEdit.js. By

Remove “Showing 1 to N of N Entries” Shiny DT

浪尽此生 提交于 2020-07-14 06:23:33
问题 Issue: I'm looking to remove the showing 1 to n of n entries field in shiny DT. Please see picture below of what I would like to REMOVE. Any insight is much appreciated. 回答1: You can use the dom option to determine which elements of the data table are shown. In the call to data table, you pass a named list of options to the options argument. dom accepts a character string where each element corresponds to one DOM element. # only display the table, and nothing else datatable(head(iris),

Remove 'search' option but leave 'search columns' option

只愿长相守 提交于 2020-07-13 23:52:44
问题 I would like to remove 'global search' option from my application, but leave 'column search' option. Any ideas? I've tried different paramethers like searching=FALSE, filtering='none' ... None of this works properly. My code: server.R: library("shiny") library("DT") data(iris) shinyServer(function(input, output) { output$tabelka <- DT::renderDataTable({ datatable(iris, filter="top", selection="multiple", escape=FALSE) }) }) ui.R library("shiny") library("DT") shinyUI(fluidPage( DT:

Using `ggplotly` and `DT` from a `for` loop in Rmarkdown

人盡茶涼 提交于 2020-06-27 04:03:11
问题 Is that possible to use ggplotly() or datatable() in RMarkdown from inside a for loop or function? Example: --- title: "Using `ggplotly` and `DT` from a `for` loop in Rmarkdown" output: html_document --- ```{r setup, include=FALSE} library(ggplot2); library(DT) ``` ## Without `for` loop - works ```{r} datatable(cars) g <- ggplot(cars) + geom_histogram(aes_string(x=names(cars)[1] )) ggplotly(g) ``` ## From inside the `for` loop - does not work (nothing is printed) ```{r} for( col in 1:ncol

Display datatable based on certain cell selection of another datatable and in active tab in a shiny app

血红的双手。 提交于 2020-06-17 09:51:06
问题 I have the shiny dashboard below in which in tab Documents I display the first 2 lines of the iris dataset. When I click on any cell of the column Species I automatically move to the View tab. But I need the functionality described below. When the user clicks on the setosa cell of the 1st row in Documents tab the datatable in the sidebar in the View tab only should display iris dataset. When I click on the setosa cell of the the 2nd row in Documents tab the datatable in the sidebar in the

Composited Sparkline in R with DT and Shiny

我怕爱的太早我们不能终老 提交于 2020-06-11 07:39:12
问题 I have got a reference by leonawicz that can combine sparkline and DT perfectly(Many thanks for him). But, could you please give me a help to make a composited sparkline ? Thanks a lot!. Here is the sample code library(data.table) library(DT) library(sparkline) Data <- data.table(Type = c("A", "B", "C"), Value_1 = c("1,1,2,2", "2,2,3,3", "3,3,4,4"), Value_2 = c("0,1,2,3", "2,3,4,5", "4,5,6,7")) r <- c(0, 8) line_string <- "type: 'line', lineColor: 'black', fillColor: '#ccc',

Composited Sparkline in R with DT and Shiny

此生再无相见时 提交于 2020-06-11 07:39:08
问题 I have got a reference by leonawicz that can combine sparkline and DT perfectly(Many thanks for him). But, could you please give me a help to make a composited sparkline ? Thanks a lot!. Here is the sample code library(data.table) library(DT) library(sparkline) Data <- data.table(Type = c("A", "B", "C"), Value_1 = c("1,1,2,2", "2,2,3,3", "3,3,4,4"), Value_2 = c("0,1,2,3", "2,3,4,5", "4,5,6,7")) r <- c(0, 8) line_string <- "type: 'line', lineColor: 'black', fillColor: '#ccc',