Shiny

observeEvent Shiny function used in a module does not work

情到浓时终转凉″ 提交于 2020-01-21 03:50:46
问题 I'm developing an app in which I use modules to display different tab's ui content. However it seems like the module does not communicate with the main (or parent) app. It displays the proper ui but is not able to execute the observeEvent function when an actionButton is clicked, it should update the current tab and display the second one. In my code I have created a namespace function and wrapped the actionButton 's id in ns() , however it still does not work. Does anyone knows what's wrong?

Is it possible to have fixed width verbatimTextOutput and have texts change lines in Shiny?

最后都变了- 提交于 2020-01-20 09:02:25
问题 I have a simple app that uses verbatimTextOutput to display some texts. I am wondering if it is possible to have the width of verbatimTextOutput to be fixed and have the text output change lines? Please see this example (https://yuchenw.shinyapps.io/verbatimtext_bookmark/). I also attached the code below. As the attached screenshot shows, when the string is very long, the verbatimTextOutput would not show all the text. Instead, the verbatimTextOutput would show a scroll bar at the bottom.

in R shiny, how to automatically or based on function tabPanel, given we have 3 levels of lists?

好久不见. 提交于 2020-01-20 08:32:50
问题 I need to create conditional 3 levels of tabs the first level or tabPanel includes three tabs "NUTS","SWEETS","DRINKS" so the level1<-list(DRINKS,SWEETS,NUTS) the second level or is conditional on the first level for example after selecting DRINKS, would be juices, energydrinks, hotdrinks the third level would be after selecting energy drinks to "powerhorse","redbull" tried code but not working is this lists ------------------------------------------------------------------- library(shiny)

Selectize Input style in Shiny (font color of selected items)

喜你入骨 提交于 2020-01-17 15:00:53
问题 so I'm new to CSS and Shiny and I reached to change the colors of the items through testing about their names. As we can see the item Banana will have a font color yellow, Kiwi green and Tomato red. But now what I wanna do is that I want to keep these font colors when I select the items shinyApp( ui = fluidPage( tags$head( tags$style(HTML(" .item { background: #2196f3 !important; color: red !important; } .selectize-dropdown-content .active { background: #2196f5 !important; color: white

R DT datatable - format text field and vertically align another field

一曲冷凌霜 提交于 2020-01-17 12:31:06
问题 I have a dataset with a text field which I would like to display using the function datatable from the package DT . I would also like to (1) format that text field so that the line breaks are displayed and emphasis is placed on certain chunks of text; and (2) vertically align the remaining fields so that their values are pushed to the top. Consider the below example: library(DT) L <- 10 datatable( data.frame( var1 = sapply(1:L, function(x) paste("<X>",paste0(x, letters, LETTERS, "\n",

How do I assign the working directory for rmarkdown/knitr interactive doc on shinyApps.io?

一笑奈何 提交于 2020-01-17 06:54:26
问题 I have a fully functional interactive shiny doc using knitr/r markdwon. However, when I try to publish (deploy) it to shinyApps.io, I get an error saying the .PNG file I try to incorporate into the doc (using readPNG from the png package) is unable to open. I know the problem is related to working directories. In my original code I assigned a working directory to my folder (i.e., "C:/Users/NAME/documents/...." that contains both my .rmd file and my .png file. However, obviously my folder

R Shiny - prevent the app from plotting on start?

大城市里の小女人 提交于 2020-01-17 06:47:03
问题 How can I prevent shiny from plotting any data on load/ start? For instance from this example, shinyUI(pageWithSidebar( headerPanel("Click the button"), sidebarPanel( sliderInput("obs", "Number of observations:", min = 0, max = 1000, value = 500), actionButton("goButton", "Go!") ), mainPanel( plotOutput("distPlot") ) )) shinyServer(function(inhttps://shiny.rstudio.com/articles/isolation.htmlput, output) { output$distPlot <- renderPlot({ # Take a dependency on input$goButton input$goButton #

R Shiny - prevent the app from plotting on start?

与世无争的帅哥 提交于 2020-01-17 06:45:35
问题 How can I prevent shiny from plotting any data on load/ start? For instance from this example, shinyUI(pageWithSidebar( headerPanel("Click the button"), sidebarPanel( sliderInput("obs", "Number of observations:", min = 0, max = 1000, value = 500), actionButton("goButton", "Go!") ), mainPanel( plotOutput("distPlot") ) )) shinyServer(function(inhttps://shiny.rstudio.com/articles/isolation.htmlput, output) { output$distPlot <- renderPlot({ # Take a dependency on input$goButton input$goButton #

Shiny: dynamically add/ remove textInput rows based on index

不羁的心 提交于 2020-01-17 06:39:09
问题 Based on this article I changed my script: library(shiny) ui = fluidPage( actionButton("add", "Add new Row", icon=icon("plus", class=NULL, lib="font-awesome")), actionButton("remove", "Remove last Row", icon=icon("times", class = NULL, lib = "font-awesome")), tags$div(id = 'placeholder') ) server = function(input, output) { ## keep track of elements inserted and not yet removed inserted <- c() observeEvent(input$add, { id <- '' insertUI( selector = "#placeholder", where = "beforeBegin", ui

Create sunburst plot in Shiny using HTML instead of sunburstOutput

梦想的初衷 提交于 2020-01-17 05:53:18
问题 Dear members of the community, I am using the R package sunburstR in order to create a sunburst plot into Shiny . The code below works perfect and I am able to create the plot, however, I would like to remove the legend completely. For this reason I know that using HTML5 I will be able to play more with the parameters of the plot. rm(list = ls()) library(shiny) library(shinydashboard) library(sunburstR) library(data.table) ui <- dashboardPage( dashboardHeader(), dashboardSidebar( sidebarMenu(