dt

Move javascript functionality of buttons to embedded buttons with DT datatable

若如初见. 提交于 2019-12-08 12:57:51
问题 Related to a previous question, I am stuck on how to get javascript functionality running on embedded buttons in a datatable. I suspect it has to do with initiation of the javascript versus the rendering of the buttons, but so far I failed to figure out how to get the functionality work with the embedded buttons.. In the app below I gave the embedded buttons a different name, but in testing it without the regular actionbuttons in the app, and giving the embedded ones the same name, the

Displaying datatable in highcharter tooltip

允我心安 提交于 2019-12-08 08:55:47
问题 Using the first block of code in this post I want to create a tooltip that would display the list of doctors visiting a clinic on a particular day.I tried the following code which displays nothing library(DT) tltp = DT:: datatable(data.frame(Doctors = x[x$Clinic=="{point.series}"&x$VisitDate == "{point.x}",2])) hc%>%hc_tooltip(pointFormat = tltp) I also tried using the tooltip_table which gives error tltp = tooltip_table(x = NULL, y = x[x$Clinic=="{point.series}"&x$VisitDate == "{point.x}",2]

R combining data tables DT package and sparkline package box plot with target value

北慕城南 提交于 2019-12-08 04:41:14
问题 I'm using sparkline plots in a DT table as outlayed here: https://leonawicz.github.io/HtmlWidgetExamples/ex_dt_sparkline.html Boiled down dummy example as follows library(data.table) library(DT) library(sparkline) hist.A<-rnorm(100) hist.B<-rnorm(100) hist.C<-rnorm(100) current.A<-rnorm(1) current.B<-rnorm(1) current.C<-rnorm(1) #whisker should show full range of data boxval.A<-paste(quantile(hist.A,probs=c(0,0.25,0.5,0.75,1)),collapse = ",") boxval.B<-paste(quantile(hist.B,probs=c(0,0.25,0.5

selecting a marker on leaflet, from a DT row click and vice versa

一笑奈何 提交于 2019-12-08 04:05:13
问题 The minimal example below renders a leaflet map with 3 markets, and a DT table with 3 records. When a market on the map is selected, so to is the matching record on the table. However, what I cannot do, is to also have the reverse of that, where a clicked row on the table also shows the related popup on the map. I have been unable to find an example R shiny leaflet app that does something similar. CODE tweaked to reflect initial comments library(shiny) library(leaflet) library(DT) library

Is there any similar approach to conditional formating for multiple columns from excel in Shiny

纵饮孤独 提交于 2019-12-08 03:39:43
问题 I have a dataframe that is uploaded from excel and displayed as datatable in shiny, in excel we have used conditional formating to change the color of cells based on the values of both the cell itself and the value of other cells. So for example for columns ID, X,Y the logic is as follow: if -4 < X < 4 and Y < 10 color of X,Y is pink elseif Y >10 color of X,Y is bleu else X ="" or Y="" then color of X,Y is white I tried to use DT package but with no success, could anyone help me to get

Positioning DataTables elements with DOM option

寵の児 提交于 2019-12-08 03:36:34
问题 I can't correctly position the l ength changing and the f iltering input to the top-right and bottom-left respectively on my DT::datatable output in shiny using the dom option. Code: library(shiny) library(DT) set.seed(2282018) company <- data.frame(Company = letters[1:10], Sales = scales::dollar(runif(10, 200, 1230)), stringsAsFactors = F) # UI ---- ui <- function(){ fluidPage( sidebarLayout( sidebarPanel(numericInput("nums", label = "Num Input", value = 1, min = 1, max = 10)), mainPanel

R Shiny DataTables: Format numbers not by column but by row

偶尔善良 提交于 2019-12-08 01:01:07
问题 My data is a matrix like this: Buy and Hold Strategy [1,] 1.0000000000000000 19.0000000000000000 [2,] -0.6300786023496699 -0.2361973739022651 [3,] -0.0872213557701079 -0.0244237977843418 [4,] -0.3461103323781194 -0.1010012410191289 [5,] 0.0000000000000000 0.4949083503054990 [6,] 0.2520044841505053 0.2418168087629348 [7,] -0.7946470924762163 -0.7731378277502762 [8,] 1864.0000000000000000 1707.0000000000000000 As you see I need a formatting by row and not by column. For example [1,] should be

Using Plotly with DT via crosstalk in Shiny

陌路散爱 提交于 2019-12-07 18:48:35
问题 I am writing an app to read a csv file into shiny and link a plotly scatter plot with a DT table. I pretty much followed the example from the Plotly website on DT datatable (https://plot.ly/r/datatable/) with the exception that the saved data from the csv is saved as a reactive input and that I have selectinput for the x and y variables for the scatterplot. I can generate the plot and DT table after clicking on the action button and I can also update the DT to only show selected rows from

Shiny/DT: column & top filter for datetime column show wrong values

不打扰是莪最后的温柔 提交于 2019-12-07 12:52:06
问题 I am having bit of trouble to figure out why my column and filter for datetime column shows the wrong date and time. My data looks like this ( dput is in shiny code below ): DATUM NUMMER 1 2017-03-29 00:00:02 19 2 2017-03-29 00:00:36 20 3 2017-03-29 00:00:40 21 4 2017-03-29 00:00:44 22 5 2017-03-29 00:00:47 23 6 2017-03-29 00:00:51 24 7 2017-03-29 00:00:55 25 8 2017-03-29 00:00:59 26 9 2017-03-29 00:01:03 27 10 2017-03-29 00:01:07 28 As we can see, it is nothing special. After displaying this

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

让人想犯罪 __ 提交于 2019-12-07 11:36:29
问题 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 answer https://github.com/r-spatial/mapedit/issues/56 - check timelyportfolio's comment on Jul 23, 2017. As it shows in the gif, I would like to be able to select a row in the datatable so that the corresponding map object (marker/polyline) is