Shiny

Add bootstrap tooltip to column header in shiny app

柔情痞子 提交于 2020-01-03 04:30:27
问题 I am trying to add tooltips to each column header of the data table, but failed. Could anybody teach me how to do this using jQuery. Thanks shinyApp( ui = fluidPage( fluidRow( tags$head( tags$script( src = "https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"), tags$script( src = "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js") ), column(12, tableOutput('table') ) ) ), server = function(input, output) { output$table <- renderTable(iris) } ) # DataTables

R Shiny - Inserting dynamic UI inside a Shiny module

∥☆過路亽.° 提交于 2020-01-03 03:35:06
问题 The app below contains a module that inserts a UI object each time the Add button is clicked. The UI object consists of two inputs: Input 1 is a selectInput with choices A and B . Input 2 is a textInput if the user chooses A and a numericInput if they choose B . However, when I click Add , the inserted UI only contains Input 1 (the selectInput ) - Input 2 is not rendered, as shown below: Whereas the desired output looks like this: I'm not sure if this is a namespacing issue or if there is a

How to highlight R or Python code in markdown chunk embedded in shiny app

血红的双手。 提交于 2020-01-03 03:25:30
问题 I am trying to return a dynamic code chunk in R as part of a shiny app. A simple example of what I am trying to do is, library(shiny) runApp(list( ui = bootstrapPage( sliderInput("mu", "Mean", min=-30, max=30, value=0, step=0.2), uiOutput('chunk') ), server = function(input, output) { output$chunk <- renderUI({ HTML(markdown::markdownToHTML(text=paste0("```{r}", "\n dnorm(0, ", input$mu,", 2)"), options=c("highlight_code"))) }) } )) This produces an unformatted code chunk. I would like to be

How to bring in a d3JS javascript file to R Shiny to draw for a Force Network graph?

半世苍凉 提交于 2020-01-03 03:11:10
问题 I am trying to build a shiny app that displays a complex force network graph that I have coded in d3JS. This goes beyond what I can do the R package networkD3, which I have tried. I instead want to bring in my highly customized .js file that handles the display and this is where I am lost. To keep things simple let's consider the simplest of force network graphs, adapted from here: http://bl.ocks.org/sathomas/11550728 If someone can show me how to bring in the file SimpleFN.js (see below)

R shinyjs shinydashboard box uncollapse on action button input

你说的曾经没有我的故事 提交于 2020-01-02 21:53:49
问题 In my shiny app, I have few boxes that are collapsed when application starts. Upon clicking on action button, calculations are run and then box should uncollapse and show results. Here is an example code that I am using, but it does not uncollapse the box. I got the code for "jscode" from here How to manually collapse a box in shiny dashboard. I believe this code was for collapsing the box upon clicking the button; I am not sure how to make it to uncollapse the box upon clicking the button.

Reduce number of gridlines in plotly scatter plots with log scale in R shiny

孤街浪徒 提交于 2020-01-02 19:14:45
问题 I've build the following test app where I solve the issue to get the tick labels as scientific annotation, but I would now like to reduce the number of grid lines to only be placed at the "main" ticks, i.e. the ones that have a text label. This question was posted based on discussion / comment on this previous SO question I would like to find a way that works for both 2D and 3D plotly scatter plots since I am using both. Here is the 3D app. library(shiny) library(plotly) shinyApp( ui =

R shiny: reloading data with fileInput

对着背影说爱祢 提交于 2020-01-02 12:21:19
问题 Is there a way to reload input file, which was loaded with fileInput? I would like to allow the user to update his input by simple modification and reloading of csv file. It seems like reloading the file does not update it. One workaround, which helps is to save the modified data with different file name. I've tried already exchanging fileInput function with an actionButton and file.choose(), but it won't work with R server Here's my test code: server.R shinyServer(function(input, output,

R shiny: reloading data with fileInput

早过忘川 提交于 2020-01-02 12:20:28
问题 Is there a way to reload input file, which was loaded with fileInput? I would like to allow the user to update his input by simple modification and reloading of csv file. It seems like reloading the file does not update it. One workaround, which helps is to save the modified data with different file name. I've tried already exchanging fileInput function with an actionButton and file.choose(), but it won't work with R server Here's my test code: server.R shinyServer(function(input, output,

Validate inside downloadHandler

偶尔善良 提交于 2020-01-02 11:06:45
问题 I want to perform some validation inside downloadHandler , so that when the condition is true a custom message is given else download of data. I have the following code example where I want to perform validation, but it seems not working. shinyApp( ui = basicPage( textInput("jobid", label = "Enter job ID", value = ""), downloadLink("downloadData", "Download") ), server <- function(input, output) { # Our dataset data <- mtcars output$downloadData <- downloadHandler( filename = function() {

How to 'save' reactive dataframe as non-reactive in shiny/R

和自甴很熟 提交于 2020-01-02 10:34:16
问题 I have a reactive dataframe called meals(). I would like to be able to treat it as a non-reactive dataframe. However, meals2<-as.data.frame(meals()) does not give the expected result. So, I tried meals2=reactive({ as.data.frame(meals()) }) and that does not work either, and I think that would give me another reactive dataframe in meals2(), which is not what I want. I know I am misunderstanding some of the basics here. Does anyone have any pointers? 来源: https://stackoverflow.com/questions