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.

The R package DT provides an R interface to the JavaScript library DataTables. R data objects (matrices or data frames) can be displayed as tables on HTML pages, and DataTables provides filtering, pagination, sorting, and many other features in the tables. See the package website http://rstudio.github.io/DT for more information.

1888 questions
17
votes
2 answers

How can I reduce row height in DT datatables

I would like to be able to get 'slimmer' rows when rendering a DT datatable (ie decrease that height) options(digits.secs=6) library(data.table) d = data.table(x = 1:10,time = as.POSIXct('2015-03-23 12:00:00.123')) library(DT) datatable(d)
statquant
  • 13,672
  • 21
  • 91
  • 162
17
votes
2 answers

Shiny: Merge cells in DT::datatable

I would like to merge few rows in column in DT::datatable in shiny. Is it possible to do so? Currently I am able to output which looks something like this: But ideally I would like to merge the rows and want to output something like this: Is it…
SBista
  • 7,479
  • 1
  • 27
  • 58
17
votes
1 answer

Change column names in DT package right before output to Shiny app

I would like to change the column names of a datable at the very last step before I output it in a Shiny app. The display names are quite long, and I do not want to change them while I'm manipulating the datatable. There are a lot more formatting…
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
16
votes
2 answers

R Shiny DT - edit values in table with reactive

Is it possible to update a reactive data source by editing the DT::DataTable? Below code is based on this code with change that x is made reactive. The problem starts when trying to change x in observeEvent. The purpose of having x reactive is…
Vlad
  • 3,058
  • 4
  • 25
  • 53
16
votes
1 answer

Adjusting the width of the datatable using DT in R

This is a script for a data table that is created in R shiny.I am trying to fit the plot within the box completely by adjusting the width of the plot. Below is the script of the plot along with the box in which I am trying to fit. Please help me to…
Ashmin Kaul
  • 860
  • 2
  • 12
  • 37
16
votes
1 answer

styleColorBar Center and shift Left/Right dependent on Sign

I am looking to create bars that when using DT's datatable appear in the middle of the cells of a column and reach out left or right depending on whether the value in the cell is positive or negative. I have tried using the function styleColorBar…
Ashley Baldry
  • 850
  • 9
  • 23
15
votes
1 answer

R vertical scroll not working

I am trying to get a vertical scroll but this isn't working, can anybody explain why? I would also like to default to show 20 rows at once. Thanks title: "Untitled" output: flexdashboard::flex_dashboard: orientation: columns …
Anon.user111
  • 468
  • 1
  • 5
  • 16
14
votes
2 answers

How do I get the data from the selected rows of a filtered datatable (DT)?

The DT package allows you to get the indices of selected rows using input$tableID_rows_selected. This works great for tables that do not have filtered data. However, if we have a filtered dataset, we can't use this same approach, as the row indices…
tbadams45
  • 848
  • 1
  • 8
  • 19
14
votes
1 answer

How can I explicitly set column width for R DT tables using R Markdown?

I have a table with multiple variables with long variable names and long character strings as values for multiple observations. How can I explicitly set each column width, so the table rendered to HTML via R Markdown won't automatically double the…
QY Luo
  • 331
  • 1
  • 4
  • 11
14
votes
4 answers

R shiny datatable filter box size to narrow to see text

I'm building an R shiny dashboard and when I put my data in a table using the DT package and renderdatatable(). At the top of each column, I have filters, the search box is too narrow to see the text and select an option. Here's an image: Does…
Tracy
  • 699
  • 2
  • 9
  • 21
13
votes
1 answer

Add and delete rows of DT Datatable in R Shiny

I'm trying to add a "save inputs" feature to my Shiny app where the saved inputs would be saved in a DT data table. If a user clicks an Add button, the inputs would be appended to a data table. A user then can delete a row from this data table by…
Agrosel
  • 489
  • 3
  • 15
13
votes
2 answers

Remove "Showing 1 to N of N Entries" Shiny DT

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.
datanalyst
  • 351
  • 1
  • 3
  • 15
12
votes
2 answers

How to edit and save changes made on Shiny dataTable using DT package

I would like to edit the table and save the changes to the example below. Here's what I have so far. library(shiny) library(DT) Admit<-c("Admitted","Rejected","Admitted", "Rejected", "Admitted", "Rejected", "Admitted", …
Chumbs
  • 188
  • 1
  • 1
  • 10
12
votes
1 answer

Edit datatable in Shiny with dropdown selection for factor variables

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 <-…
dwhdai
  • 194
  • 2
  • 12
12
votes
1 answer

Shiny - how to highlight an object on a leaflet map when selecting a record in a datatable?

Is there a way to highlight a marker or polyline on a leaflet map when selecting (clicking on) the corresponding record in a datatable? I looked at these questions/threads: selecting a marker on leaflet, from a DT row click and vice versa - no…
M_M
  • 899
  • 8
  • 21