Questions tagged [dt]
DT is an R package that provides an interface to the JavaScript library DataTables. Use the data.table tag for questions related to the data.frame extension package data.table.
1,609
questions
1
vote
0
answers
14
views
How to remove the </a tag when downloading a CSV file with hyperlinks in it using the DT package?
In the following example, I created a simple datatable. The third column contains hyperlinks. The datatable also contains a button allowing users to download the table as a CSV.
However, in the ...
0
votes
0
answers
10
views
How to eliminate the bottom border line while using autoWidth
I am looking for a way to eliminate the bottom border line in my DataTable. I've found one solution (link below) but it does not work with autoWidth argument that I would like to keep. Any idea would ...
1
vote
0
answers
12
views
Currently there is a way to disable some keyboard shortcuts in xaringan slides?
I have a DT table with some normality test results, the idea is that the reader can search for the result he/she is interested in using the keyboard.
The problem is that when typing some words the ...
0
votes
1
answer
21
views
R Shiny communicate column sizes between R and Javascript with colResize
I'm using this plugin to enable manual column resizing for the DataTables in R Shiny. Now I would like to save the column width state after the user resized the table. For this I would like to ...
0
votes
1
answer
30
views
How to copy multiple row and column headers in a rendered table when using DT table copy function?
A similar question was posted but never answered: r shiny problem with datatable to copy a table with table head (colspan)
When running the below reproducible code, I'd like the DT "copy" ...
1
vote
0
answers
29
views
DT editable = "column" not functional
In the examples on https://yihui.shinyapps.io/DT-edit/, when editable = "column" the results won't render and be retained in the table. Indeed, they only work if editable = TRUE or editable =...
0
votes
0
answers
23
views
Align search bar and title in table using datatable package in R
I've searched extensively online and haven't found a solution for this using reactable, datatable, or formattable. I'm trying to create a table where the title of the table is aligned with the search ...
0
votes
0
answers
11
views
Is there a way to freeze the horizontal scroller in DT?
I have a data frame with a lot of rows and columns, so I added a horizontal scroll bar so the columns wouldn't be squished. However In order to access the scroll bar I need to scroll all the way to ...
0
votes
0
answers
22
views
Remove "Previous 1 Next" Shiny DT
Since my table consists of two rows, is there any way to remove "Previous 1 Next" below the table?
My code is:
output$users <- renderDT(users_data, editable="all", options = ...
0
votes
0
answers
8
views
Fixed colums can't Align other colums
I use DT::data.table in my shiny app, but the fixed colums can't match other cols.
It's my ui and server code:
Ui.R
DT::dataTableOutput("mytable2")
Server.R:
output$mytable2 <- ...
0
votes
1
answer
29
views
Implement Individual column searching using JS in DTedit
In my datatable, I would like to implement individual column searching shown in this page:
https://datatables.net/examples/api/multi_filter.html
I am using DTedit R package, an extension to DT, and it ...
0
votes
1
answer
22
views
R Shiny making DataTable columns manuallly resizable
I would like to ask if it is possible to let the user manually adjust the column widths by clicking on the column and dragging it. If so, how?
1
vote
1
answer
67
views
Change selected cell background color in a Shiny DT table based on rules?
Is it possible to change the background color of user-selected cells in a Shiny app DT table based on programmatic rules and reactive values?
I can customize the color of ALL user-selected cells with ...
0
votes
1
answer
38
views
How to return a reactive dataframe from within a shiny module that depends on a button click?
Aim: Return a reactive dataframe object from within the module named "modApplyAssumpServer"
Problem: I am getting an endless loop. Even if I wrap everything within the observeevent logic ...
0
votes
1
answer
21
views
How to add fileInputs into DT
I need to add a fileInputs to each row of a table. Unfortunately, this widget does not work correctly, unlike regular actionButtons and other elements. The window for selecting a file is called, but ...
0
votes
1
answer
41
views
Position DT search box to center of table
I am having a hard time figuring out the code to position the search box from a DT table in a Shiny app to the middle. I'm using a DT extension package, called DTedit, to create my table. Here is some ...
1
vote
1
answer
32
views
capture output of editable datatable in R shiny app to be used in another table
I am trying to capture edits to a datatable (mytable) and then create a second datatable (new_table) which reflects the edits. There is a separate input$rows and input$columns which determines how ...
0
votes
1
answer
35
views
Adjust place of downloading buttons of a DT table in Shiny
please see this picture
I have a DT table in the shiny. I added buttons for downloading the content of the table (Copy, CSV, Excel, PDF). But I would like to change the distance between the first ...
0
votes
0
answers
31
views
R Data bar issue with the Year column in DT table
I am creating an xaringan presentation via RMarkdown which includes a DT table consisting of databars. When I use the code below I get the following error:
Error in FUN(X[[i]], ...) :
only defined ...
2
votes
1
answer
22
views
Rshiny Radio button in several DT table
I need to insert radio buttons in a shiny DT datable application. I took inspiration from here (inst/examples/DT-radio/app.R) to do it.
However, for my case, I have several tables (not just one) and I ...
0
votes
1
answer
29
views
Radio buttons in a reactive table
I'm trying to create a reactive datatable with embedded radio buttons in Shiny.
The example below is based on https://yihui.shinyapps.io/DT-radio/ but instead of a static table I use a reactive, since ...
0
votes
1
answer
23
views
R: Add multiple images to dataframe/datatable?
I'm trying to add several images to a dataframe in R to reproduce in R Shiny as DT::dataTableOutput.
The desired output would look something like:
Icon
Food
grapes
marrow
I fount this question ...
0
votes
0
answers
30
views
Update R shiny datatable options without re-rendering
In an R Shiny app, I would like to provide users with the ability to update the initialization options for a datatable. For example, a user may want to search the datatable contents via string literal ...
0
votes
1
answer
44
views
Two JS functions for initComplete option in Datatable in Shiny
I try to combine two javascript functions into one variable so that I can call both in the DT::datatable initComplete option. The functions are working independently of each other, but when I combine ...
-1
votes
1
answer
31
views
Extraction of hour from datetime object in Pandas
When I extract hours from 23.35 using dt.hour in pandas it returns 0. But i want to get 24. How to do that?
0
votes
1
answer
50
views
Shiny: how to make a reactive input for a conditional filter in this case?
Recently I was changing the options of a DT::datatable and because I had to use formatCurrency, I was taking the datatable function outside of renderDataTable. In this case my dynamic filter by the ...
0
votes
0
answers
19
views
R datatable creating sequence numbers for group ordered by date
person_id diag_date concept_id event
1: 1 2017-11-06 4163261 primary_dx
2: 1 2017-11-30 4163261 primary_dx
3: 1 2017-12-07 4163261 primary_dx
4: 2 2018-...
0
votes
1
answer
23
views
How to retain DT Options when updating data
I have a very simple shiny app, and I want to keep autoWidth = TRUE after I hit the update button. For some reason, I get a full page-width DT after updating. What am I missing?
library(tidyverse)
...
0
votes
2
answers
26
views
R Shiny dataTableOutput - prevent column from showing full text column
I have code to present a table in my R Shiny application. There is a character column where the value within a given cell can be a large number of characters. I use the following code to create the ...
0
votes
0
answers
19
views
DT extremely slow for large matrix (50K rows x 15 columns) when doing a global search
I have a dataframe with 50k rows and 15 columns I'm trying to display using DT. When searching items on column filter boxes, the results render very quickly. However, when I introduce a global search, ...
0
votes
1
answer
33
views
Problem capturing edited data table output in modularized shiny app
I have a shiny app that utilizes a data table with drop down menus to control the updates of select columns. When I modularize the shiny app, I am no longer able to capture the results of the updated ...
0
votes
1
answer
30
views
How to fix DT::renderDataTable Indexation after Deletion of Row
After I add and delete various rows in my data table, I would like the row names to still be in chronological order (1,2,3, etc.). If I use 'row.names(df1$data) <- NULL' which I have commanded out, ...
0
votes
1
answer
29
views
Select column from dataframe using shiny widget and modify its name using textInput()
In the app below I want to select a column name from the selectInput() and then modify it using the textInput().The update will happen after the actionButton click.
library(shiny)
library(...
0
votes
1
answer
26
views
How to modify text "Showing x to x of x entries" in RShiny?
I'm trying to change text: "Showing x to x of x entries" to "Showing x to x of x rows".
I'm using
options = list(language = list(info = "Showing _START_ to _END_ of _TOTAL_ ...
2
votes
1
answer
78
views
How to merge 2 row cells in data table?
This is the next step in my attempt to build a user-friendly transition matrix in R, a follow-on to post How to add a vertical line to the first column header in a data table?.
Running the MWE code at ...
1
vote
2
answers
27
views
Is there a way to just read an edited DT?
I'm trying to make an app where users can edit some tables and run a calculation, and using DT. Is there a way to just read in what's currently in a DT table? This would simplify things a lot for me. ...
2
votes
1
answer
100
views
How to merge 2 row headers in a single column in a data table and insert a reactive object?
This is the next step in my attempt to build a user-friendly transition matrix in R, a follow-on to post How to add a vertical line to the first column header in a data table?. I have been spoiled by ...
1
vote
1
answer
31
views
DT::renderDT not working when more than one tabPanel
This code fails to produce a table in the tabPanel "table", however, when I comment one of the other tabPanel (e.g. "Overview") it works fine. Any idea why that might be?
library(...
2
votes
1
answer
111
views
How to add a vertical line to the first column header in a data table?
I would like to add a vertical line to a DT table column header. There is guidance for adding this line in post How can I add a vertical line to a datatable?, but it applies to a static table where ...
0
votes
1
answer
23
views
How to add a secondary row header to output table with an embedded reactive object?
This is a follow-on or refinement to post How to add reactive object to secondary column header in output table?
The MWE code at the bottom produces a very nice secondary column header with embedded ...
1
vote
1
answer
31
views
How to add reactive object to secondary column header in output table?
I am working on a transition table module and am wrestling with how to make the output understandable for the user. I used to prepare transition tables in Excel; making the table legible was super ...
0
votes
1
answer
100
views
Rmarkdown Download data with download button for that row
Update
renderdatatable doesnt show actionbutton, renderDT shows but not able to just download the table although i can see the actionbutton being triggered with cat statement
I'm new to markdown ...
0
votes
1
answer
44
views
Shiny DT unable to add buttons to download as csv/excel
Having trouble adding buttons for "download as csv/excel" to my Shiny app DataTable section.
It seems that as my "Data" is queried from redshift, it doesn't recognize it as a data ...
0
votes
1
answer
61
views
use Shiny.setInputValue inside module from DT callback
I have a problem inside a bigger app, I narrowed it to this repex
I have a DT table inside a module. I need to get data from rows of that table by clicking on it. For that, I use the callback param ...
0
votes
0
answers
67
views
How to format selected rows of a DT datatable in RShiny?
So I have a DT datatable in my R shiny that only has two columns, one has 20 rows of names and the other one has amounts that change depending on user input. I'd like to know if there's a way to bold ...
0
votes
1
answer
69
views
Download DT::datatable as pdf in shiny app
Is it possible to download a DT::datatable as pdf through a shiny app ?
#app.r
library(shiny)
library(ggplot2)
library(magrittr)
library(DT)
ui <- shinyUI(
fluidPage(
column(3,
...
0
votes
1
answer
46
views
checkBox elements with editable cells in Shiny DT datatable
I have built upon yihui's suggestion to add checkboxes to a DT datatable. I also need to be able to edit values in cells (not the checkboxes, the adjacent columns. The behavior is follows: I click on ...
1
vote
0
answers
50
views
Disable slider in search bar in DT package in Shiny?
I'm trying to remove the slider in the search bar in datatables where the column is numeric:
I want the column to be filtered on an exact value and not between two values, hence I want the slider ...
0
votes
2
answers
59
views
conditional formatting of cells using if else? or hiding columns in DT package in R
I have a table that looks like this.
data_wide <-data.frame(id=c(1,2,3,4),book1=c("","","","age"),book2=c("covid","alive","",&...
1
vote
0
answers
71
views
nested reactable to stay expanded when input data change shiny
I am making a shiny app where the user selects objects and data in selected objects sums to totals in a nested reactable table. I am using a reactible table, with DT tables nested inside (maybe not ...