dt

shiny DataTables footer Callback sums

不羁的心 提交于 2019-12-13 17:26:51
问题 I'm working on implementing a callback function for DataTables in a shiny app similar to this example from the DataTables forum. My thought so far from reading the DT documentation (section 4.4) was that it might be possible to apply the same class sum through the columnDefs argument of options as below, but it would also make sense if I just knew where to put the JS argument to do the classes manually like in the link. You can delete all the columnDefs and callback arguments to see an

Hover Tool Tip over DataTable value in R?

纵然是瞬间 提交于 2019-12-13 04:34:12
问题 Is there any way to get a hover tool tip working on a shiny data table that has some information, this is possible on graphs but never seen it done before on a data table 回答1: Yes, like this (no need of Shiny): library(DT) datatable(head(iris), options=list(initComplete = JS(c( "function(settings){", " var table = settings.oInstance.api();", " var cell = table.cell(2,2);", " cell.node().setAttribute('title', 'TOOLTIP CONTENTS');", "}"))) ) table.cell(2,2) means the cell at row 2 and column 2;

How to update DT datatable in Shiny when within a module and the selection criteria are changed

孤者浪人 提交于 2019-12-13 03:45:46
问题 I try to make a shiny module to present data from dataframes using the DT package. I would like to use a module to have a standard set up of DT-table options like language and others. I want the user to be able to select different subsets of the data interactively and thereafter be able to see the data as a DT-table. The selection of the subset will be generated outside the module because I would like the subset to be available for other uses, for example to be exported to a csv-file. This

R shiny datatable with numericinput and reactive column

核能气质少年 提交于 2019-12-13 03:41:33
问题 I am building a shiny datatable with one column for numericinput and the other reactive to the input. It is similar to what you can do in excel with equation embedded in cells. I am giving iris as example below and trying to calculate petal area. So peal area equals Petal.Length*Petal.Width/Adjust. The adjust parameter will be typed in by user to adjust area. A similar question was asked here but with no direct answer. Insert a numeric input for each row - R Shiny library(shiny) library(DT)

R - Formatting by row using DT

北城以北 提交于 2019-12-12 21:40:04
问题 I have a data table that I want to display in a Shiny app with different number formatting by row. I found a previous solution by user NicE that works when all columns and rows are numeric, seen here: R Shiny DataTables: Format numbers not by column but by row Unfortunately, my first column is non-numeric, and with my table the above solution gives NaN% values in the first column and does not format the later columns. I'm sure there is a way to resolve this, but I do not know JavaScript so I

R - Shiny - Where can we find the .tar.gz file of the master version of DT package?

喜夏-厌秋 提交于 2019-12-12 18:26:35
问题 I need to install the version 0.1.40 of the DT package (https://github.com/rstudio/DT) on a Linux server which is not connected to internet. Thus I can't use the statement devtools::install_github('rstudio/DT') . Thus I need to get the DT_0.1.40.tar.gz file to install this development version of DT. Where can I find the tar.gz file of the version 0.1.40 of DT ? Thanks. 回答1: If you are fine with the version on CRAN, you can go to DT 's page on CRAN to download the package tarball. There is a

How to customize datatable by row with custom threshold

一个人想着一个人 提交于 2019-12-12 16:51:30
问题 This is related to this other question link. Currently I'm using this code in order to apply some styling to my table. I need to color each cell only if the value exceeds the 3rd quantile of the row , the problem is that DT doesn't seem to allow to work by row , just by column . formattable() works ok, but I lose some useful proprieties from DT , for example the possibility to edit the cell with editable=T . library(formattable) library(DT) dat <- as.data.frame(matrix(AirPassengers, ncol=12,

Radiobuttons in Shiny DataTable for “subselection” of rows/ grouping in one column

瘦欲@ 提交于 2019-12-12 14:41:31
问题 What I am trying to accomplish is similar to this thread, but slightly more complicated. I would like to group the radio buttons into different groups, but in one column so a "subselection" of rows is possible. Currently only the radio button group with ID "C" works, because the div element is defined for the whole table. I have tried to insert the shiny tags via javascript callback, but I'm only able to insert a radio button for each row or for each column, but not for a subset of multiple

how to render DT::datatables in a pdf using rmarkdown?

萝らか妹 提交于 2019-12-12 10:48:52
问题 How can I display DT::datatable objects from a rmarkdown script onto a pdf document? My code so far is breaks down with the following error: processing file: reportCopy.Rmd output file: reportCopy.knit.md Functions that produce HTML output found in document targeting latex output. Please change the output type of this document to HTML. Including always_allow_html: yes in the YAML header suppresses the error, but nothing appears on the pdf. I would be grateful for any help. My code is

DataTables apply column formatting to filter also

天涯浪子 提交于 2019-12-12 07:13:04
问题 When creating a datatable with filter = 'top' and also using a formatting function on a column, the formatting isn't applied to the filter control for that column. Is there a way to format the filter controls as well? For example, if I have floating-point numbers formatted as a percentage, the slider in the filter still shows floating point numbers. library(DT) my_data <- mtcars my_data$wt_pctile <- trunc(rank(my_data$wt)) / length(my_data$wt) datatable(my_data, filter = 'top') %>%