dt

tooltip or popover in Shiny datatables for row names?

大兔子大兔子 提交于 2019-11-29 07:41:46
I’m stuck with trying to include something like a tooltip or popover with additional info when the user hovers over / clicks on the row names of a datatable, so they don’t have to look up some definitions, which I currently have on a different tabPanel. Here's a working example: server.R: library(shiny) library(DT) library(shinyBS) # Define server for the Shiny app shinyServer(function(input, output,session) { tdata <- as.data.frame(iris) # Render table here output$mytable <- DT::renderDataTable(DT::datatable( tdata[1:5,], options = list(paging = FALSE, searching = FALSE, info = FALSE, sort =

Hide certain columns in a responsive data table using DT package

十年热恋 提交于 2019-11-29 03:23:29
I am trying to create a responsive data table for my shiny application using DT package. I want to hide certain columns in advance. For example: library("shiny") library("DT") shinyApp( ui = fluidPage(DT::dataTableOutput('tbl')), server = function(input, output) { output$tbl = DT::renderDataTable( iris,extensions="Responsive" ) } ) This output gives me 5 columns. It only hides columns when I narrow the page. But, I want to hide last 3 columns in advance and I just want to see first two columns every time. Is there a way to do that? Update: Example output You can hide columns in your table

How do I suppress row names when using DT::renderDataTable in R shiny?

喜夏-厌秋 提交于 2019-11-29 02:50:24
As per the explanation in section 2.3 here , I can remove rownames for a datatable by setting rownames = FALSE How do I suppress row names when using DT::renderDataTable in R shiny? The following doesn't work because if you look at the dataTables options reference there is no rownames option output$subsettingTable <- DT::renderDataTable( subsetTable(), filter = 'top', server = FALSE, options = list(pageLength = 5, autoWidth = TRUE, rownames= FALSE )) My question is similar to the one here . The answers there are for renderTable and I've tried making the answers there work with DT:

Pre-select rows of a dynamic DT in shiny

最后都变了- 提交于 2019-11-28 14:32:23
This question is the more dynamic version of this . I have a DT in shiny app that could be empty at initialization. I'd like to pre-select all rows in DT. My first try is like this: library(shiny) library(DT) shinyApp( ui = fluidPage( fluidRow( radioButtons("select", "", c("none", "iris")), DT::dataTableOutput('x1') ) ), server = function(input, output, session) { data <- reactive({ if (input$select == "none") { return(NULL) } else if (input$select == "iris"){ return(iris) } }) output$x1 = DT::renderDataTable( data(), server = FALSE, selection = list(mode = 'multiple', selected = seq_len(nrow

DT cell hover showing cell based sample sizes from hidden column

会有一股神秘感。 提交于 2019-11-28 12:40:16
问题 I have previously asked how to colour cells based on colours stored in hidden columns (link). I saw that it is also possible to apply hover information for (DT) tables via this and this post. I want to expand my initial post where I want to add the hover option to display the sample sizes related to the individual cells. These sample sizes are not shown in the table (i.e. hidden) but only display on hover. I am really pushing my knowledge of Java to make this work. Following on from my

R shiny mouseover text for table columns

不问归期 提交于 2019-11-28 06:01:05
How can I create mouseover text for column names in R shiny data table display. I'm trying to provide some text for users to understand the column names. I checked in DT package also and I couldn't find a solution. I can create labels for column names and display all of them when a user checks a box, this takes a lot of real estate and I don't want that. Any tips? To expand my comment above, here is an example showing what I meant by using the title attributes: library(DT) sketch = htmltools::withTags(table( class = 'display', thead( tr( th('', title = 'Row Names'), th('Sepal.Length', title =

R Shiny: Editing DT with locked columns

人走茶凉 提交于 2019-11-28 05:03:13
问题 I am trying to have a DT that is editable by the user but I only want certain columns to be editable. Since this isn't a feature yet in DT , I am trying to hack it together by having the table refresh back to the original value when edited a column that I want "locked". Below is my code: library (shiny) library (shinydashboard) library (DT) library (dplyr) library (data.table) rm(list=ls()) ###########################/ui.R/################################## #Header---- header <-

R - Download Filtered Datatable

落花浮王杯 提交于 2019-11-28 02:12:19
问题 I would like to be able to download a datatable after it is filtered using it's built in search. Either that or be able to filter a dataframe using the same kind of search used in a datatable and access the search on a datatable. 回答1: If you use client side processing, you can accomplish this with the input object input[["tablename_rows_all"]] . (append _rows_all to the name of the datatable output slot) The _rows_all object will return the row indices of your data frame. You can use that

DT apply background colour to cell based on separate data frame

回眸只為那壹抹淺笑 提交于 2019-11-28 02:10:35
问题 I have a table to which I would like to apply background colours to individual cells. The colours have no obvious direct relationship with the data presented, and are specified in a separate data set. How would I apply the background cell colours specified in: set.seed(123) colours2apply <- sample(x=c(rgb(1, 0, 0 ), rgb(1, 1, 0 ), rgb(0, 1, 1 )), 25, replace = T) %>% matrix(nrow=5) %>% data.frame() > colours2apply X1 X2 X3 X4 X5 1 #FF0000 #FF0000 #00FFFF #00FFFF #00FFFF 2 #00FFFF #FFFF00

Include link to local html file in DataTable in Shiny

我的梦境 提交于 2019-11-28 02:09:35
问题 I want to include a link to a local html file, which lives inside the www directory of my shiny app, inside a column in data.table. On click a new tab should open showing the html file. I've found solutions for linking to internet pages, but how do I adjust this, so that Shiny finds the local files, when rendered in a browser? This is my code library(DT) library(shiny) link <- "www/my_html.html" link <- paste0("<a href='", link,"' target='_blank'>", link,"</a>") # works fine for global url,