dt

Display Image in a Data Table from a local path in R Shiny

送分小仙女□ 提交于 2020-01-24 15:31:30
问题 I am trying to display the Image in a Data Table from a local path . Please note the local path is different from www folder and in real scenario, I can not move the images from the prescribed path to www folder. Strange thing is that it is working from www location and but not from the prescribed path. Looking for any tips to resolve this. Here is the code: library(shiny) library(shinyBS) library(DT) flag <- data.frame(image=c('<img src="C:/Users/string/100x100/100x100_bigimg.jpg"></img>'))

DT::datatable customization stripes

柔情痞子 提交于 2020-01-24 12:13:11
问题 The DT package within R provides an amazing set of functions to create interactive tables within your Rmarkdown documents or Shiny Apps. The vignette / help page is very informative and will help with most problems. See here However, when it comes down to changing the color of the stripes, I'm struggling to find a straightforward solution. Based on the answer here, I came with the following to change the color of the stripes: markets_list <- c("GC=F","SI=F","PL=F","CL=F","BZ=F","^TNX","^TYX",

How to use an editable DataTable in Shiny as input for another DataTable

ぐ巨炮叔叔 提交于 2020-01-23 09:50:09
问题 I want the user to be able to edit the already-loaded DataTable, click a button and then have the edited version used as input to do stuff. So in this example, how could I make the new user-edited versions appear in the "New" tabs upon clicking of the "Change Dataframes" button? User Interface shinyUI(fluidPage( titlePanel(), sidebarLayout( sidebarPanel( actionButton("runButton","Change Dataframes") ), mainPanel( tabsetPanel( tabPanel("OldIrisTab", DT::dataTableOutput("OldIris")), tabPanel(

How to use an editable DataTable in Shiny as input for another DataTable

余生颓废 提交于 2020-01-23 09:50:03
问题 I want the user to be able to edit the already-loaded DataTable, click a button and then have the edited version used as input to do stuff. So in this example, how could I make the new user-edited versions appear in the "New" tabs upon clicking of the "Change Dataframes" button? User Interface shinyUI(fluidPage( titlePanel(), sidebarLayout( sidebarPanel( actionButton("runButton","Change Dataframes") ), mainPanel( tabsetPanel( tabPanel("OldIrisTab", DT::dataTableOutput("OldIris")), tabPanel(

How to display in shiny app a matrix, specifying the color with conditionals?

安稳与你 提交于 2020-01-14 15:57:10
问题 I have a matrix M with positive values and negative values. I am trying to display as a table in shiny app, using the DT package. I would like to display the matrix with different colors. Positive numbers in red and negative numbers (for example). So far, I only can add colours in a one-to-one way . But I want to add colours in this way: if matrix_values > 0 "color1", if matrix_values < 0 "color2". M <- matrix(c(-3:2), 3) # The matrix is more complex and it's created in a reactive environment

How to display in shiny app a matrix, specifying the color with conditionals?

怎甘沉沦 提交于 2020-01-14 15:57:05
问题 I have a matrix M with positive values and negative values. I am trying to display as a table in shiny app, using the DT package. I would like to display the matrix with different colors. Positive numbers in red and negative numbers (for example). So far, I only can add colours in a one-to-one way . But I want to add colours in this way: if matrix_values > 0 "color1", if matrix_values < 0 "color2". M <- matrix(c(-3:2), 3) # The matrix is more complex and it's created in a reactive environment

R DT datatable not retaining row index/counter column after selecting new page when using callback option

只愿长相守 提交于 2020-01-14 13:34:29
问题 I am using this question as a reference to add a "row index" or "counter column" (as described in the datatable documentation here) to a DT::datatable in a Shiny application. The intent is to hold the row names in the table constant (1, 2, 3...) regardless of the sorting that is applied to the table. The user NicE answered this question by converting the javascript code in the datatable documentation for use in the callback of the DT::datatable options: output$tbl = renderDataTable({

Is it possible to set the tickboxes selected by default in a DT datatable?

妖精的绣舞 提交于 2020-01-14 03:23:28
问题 I would like to ask if it is possible to have the tickboxes of all the rows selected by default -instead of deselected- in a DT datatable. library(DT) library(tidyverse) dataTableOutput("irisTable") output$irisTable <- renderDataTable( iris %>% rowid_to_column("Row") %>% mutate(Row = ""), rownames = FALSE, extensions = "Select", options = list( columnDefs = list(list(className = "select-checkbox", targets = 0, orderable = FALSE)), select = list(style = "multi", selector = "td:first-child") ))

Highlight part of a string in a cell content based on a filter value

不羁岁月 提交于 2020-01-13 19:01:53
问题 As the next step to the example provided in http://rstudio.github.io/DT/010-style.html I wish to highlight a part of a string in a cell based on a filter value as shown in the image below. I am trying to highlight specific motifs in biological sequence data in table format. Given below is the Excel VBA code and a representative image. Is it possible to achieve this in R? Sub SequencePartColourMacro() Dim Col, Row, FirstRow, LastRow As Integer, Col As Long Col = 6 FirstRow = 2 LastRow =

Create a table with clickable hyperlink

谁说胖子不能爱 提交于 2020-01-13 06:11:42
问题 I have an R data frame, which is displayed on RShiny output called by renderDataTable. However, I am unable to implement a simple Java or html tags that helps me to do the following. Example: (I am inserting the server.ui code, considering that these parameters are to be set at server.ui end. ) For simplification representing only 2 rows. mydataframe Col1 Col2 Col3 Google 5 lines description www.google.com Yahoo 5 lines description www.yahoo.com Goal is to rederDataTable output on shiny so