dt

DataTable: Remove all horizontal borders

妖精的绣舞 提交于 2020-01-03 18:01:08
问题 How do I remove all the horizontal borders to just the even/odd shading? https://datatables.net/examples/styling/stripe.html This doesn't work. table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td { border: none; } I would also like to remove the top and bottom black borders. This doesn't seem to have any effect. table.dataTable thead th { border-bottom: 0; border-style: none; } table.dataTable tfoot th {

How to format DT background *per row*?

大兔子大兔子 提交于 2020-01-02 20:14:13
问题 I want to use DT's formatStyle() to give a colour gradient per row . Given this sample data: library(DT) data <- round(data.frame( x = runif(5, 0, 5), y = runif(5, 0, 10), z = runif(5, 0, 20) ), 3) break_points <- function(x) stats::quantile(x, probs = seq(.05, .95, .05), na.rm = TRUE) red_shade <- function(x) round(seq(255, 40, length.out = length(x) + 1), 0) %>% {paste0("rgb(255,", ., ",", ., ")")} I can colour the cell backgrounds based on values in the entire table using this code: brks <

Buttons: download button with scroller downloads only few rows

风流意气都作罢 提交于 2020-01-02 02:53:07
问题 I am handling tables with more than 100 000 rows and using DT package ( development version 0.1.56 ) to visualize it in Shiny App. Furthermore I am using DT Extensions as: Buttons , to download the data in different formats. However while Scroller extension is as well activated, i am able only to download few rows (not all data). Sample code: library("shiny") library("DT") shinyApp( ui = fluidPage(DT::dataTableOutput('tbl')), server = function(input, output) { output$tbl = DT::renderDataTable

gvisTables not rendering in Shiny apps

旧巷老猫 提交于 2019-12-31 00:43:20
问题 The actual issue I'm trying to solve: I'm creating a dashboard which will include data tables. I would like for numbers to be formatted with commas as thousands separators, but there is (apparently) an issue with the DT package when it's used with Shiny, in that the comma-separated formatting causes DT::renderDataTable to read in numbers as character, which affects how the numbers are sorted. (DT's number formatting functionality does not work with Shiny, it appears.) Where I'm at so far: The

Conditional formatting in DT Data Table R Shiny

五迷三道 提交于 2019-12-30 10:54:27
问题 I have a table with 5 cols and 1st column as character and other four as numeric. I am using DT Data Table to display the same in Shiny App. Now, I need to compare each of the four cols for each row and color code the row cell which has maximum value . Looking for ways to do the same. Had a look on this link as well StylingCells but all the cols are numeric here. Code entity <- c('entity1', 'entity2', 'entity3') value1 <- c(21000, 23400, 26800) value2 <- c(21234, 23445, 26834) value3 <- c

Change mouse cursor to hand (pointer) in R Shiny

百般思念 提交于 2019-12-25 04:37:11
问题 How I can change the mouse over icon to pointer (hand) when user hover over data table cells.I am having 4 columns in a datatable and the 4th column row cells is diplaying tool tip on mouse over. I need to change the cursor icon to pointer when tool tip is displayed.I think this can be achieved through dt package options & JS but no success till now,Any Tips to achieve the same in R Shiny UI . 回答1: Used CSS Script with rowCallback feature of DT Package to achieve this.Here is the code for

Automatic row numbers (after filtering DT in shiny)

拟墨画扇 提交于 2019-12-25 03:47:16
问题 I would like to get the rownames count start again from 1,2,3... after filtering the datatable. Is it possible? Here is simple code: library(shiny) library(DT) library(ggplot2) x <- as.numeric(1:1000) y <- as.numeric(1:1000) data <- data.frame(x,y) shinyApp( ui = fluidPage(dataTableOutput('tbl'), plotOutput('plot1')), server = function(input, output) { output$tbl = renderDataTable({ datatable(data, filter = "top", rownames=TRUE,options = list( pageLength = 300, lengthMenu = c(100,200,300,400

How to pre-select cells in Shiny DT datatables

≡放荡痞女 提交于 2019-12-25 01:16:53
问题 Is there a way to pre-select cells in shiny DT datatables instead of rows? library(shiny) if (packageVersion('DT') < '0.1.3') devtools::install_github('rstudio/DT') library(DT) shinyApp( ui = fluidPage( fluidRow( h1('Client-side processing'), DT::dataTableOutput('x1') ) ), server = function(input, output, session) { output$x1 = DT::renderDataTable( iris, server = FALSE, selection = list(mode = 'multiple', selected = c(1, 3, 8, 12),target="cell") ) } ) 回答1: Please refer to the github guide

Handling and optimizing a range slider in R

馋奶兔 提交于 2019-12-25 00:33:02
问题 If you run the script below, You get a data table representing iris data and a range slider which gives you values greater than and equal to the chosen point on the prior circle of your selection in the slider. I want a logic such that when left slider node is kept at say 5 and right slider at 7, I want the data to be displayed "= and above 5" and "< and equal to 7".These values however should be dynamic. Also for the two circles on the sliders, is there a way to give triangle widgets which

dplyr - mutate: columns escaped are false in DT:datatable title edited; was (dplyr - mutate: use dynamic variable names…(used for `DT::datatable`))

我的梦境 提交于 2019-12-24 21:56:43
问题 This tips dplyr - mutate: use dynamic variable names, answer of @Tom Roth works very well, but I have a little issue. [edit: It seems than dynamic variables are not the cause. Reprex added /edit] If I change an initial column myCol to an url (for example), and copy the old column myColInitialValue at the end of the dataframe df with a new name, therefore I thought that a which(colnames(df)=='myCol') send back the col # of myColInitialValue but It seems to be an issue in DT::datatable() My