Shiny

How to change the font family of verbatimTextOutput to be the same as the input in Shiny and Shinydashboard?

六月ゝ 毕业季﹏ 提交于 2020-01-23 03:54:05
问题 I would like to change the font family of the verbatimTextOutput to be the same as the input in Shiny and Shinydashboard. Here is an example. # Load the packages library(shiny) library(shinydashboard) # User Interface ui <- dashboardPage( header = dashboardHeader(title = ""), sidebar = dashboardSidebar( sidebarMenu( menuItem( text = "Example", tabName = "tab1" ) ) ), body = dashboardBody( tabItems( tabItem( tabName = "tab1", fluidRow( column( width = 4, numericInput(inputId = "Number", label

Show/Hide button on tab select R shiny

跟風遠走 提交于 2020-01-23 03:44:07
问题 I have a button in my ui.R that I want to be shown only when "Summary" tab is selected, so I thought of this code fluidRow( column(4, column(12,id="sub", actionButton("submit", "SUBMIT", width = "100%"))), column(8, bsCollapse(id = "collapse7", open = "Results", bsCollapsePanel("Results", tabsetPanel( tabPanel("Summary", tags$script(HTML("document.getElementById('sub').style.visibility = 'visible';"))) tabPanel("Plot", tags$script(HTML("document.getElementById('sub').style.visibility =

Choose folder or folder directory inside shiny app

╄→尐↘猪︶ㄣ 提交于 2020-01-23 01:34:12
问题 I have a problem using shiny. I want to choose the folder where all the files I want to use in my app are saved either 1) by setting the working directory to that folderpath or 2) by uploading all csv data inside this folder to my app for further processing. for 1) I found the shinyFiles package but it is very very slow -not due to my PC- as well as giving me the error: Warning: Error in dir.create: invalid 'path' argument Stack trace (innermost first): 59: dir.create 58: dirCreate 57:

Shiny : showing one message for all errors

无人久伴 提交于 2020-01-22 20:02:12
问题 I have an application in R's Shiny. I would like to handle messages so that users do not see what error occurred. I know that via tags$style(type="text/css", ".shiny-output-error { visibility: hidden; }", ".shiny-output-error:before { visibility: hidden; }" ), I can disable error messages entirely, but I would like to show users one message like An error occurred. Please contact the admin. whenever message of whatever type occurs (and still keep the original error message in the log). Any

How to make kable table reactive() in shiny app? Shiny + kable

天大地大妈咪最大 提交于 2020-01-22 19:31:32
问题 I am trying to make kable table reactive and export it in shiny app. already gave a try with renderDataTable / renderTable inside server and output functions as datatableOutput / tableOutput , but of no luck and following is the line of code. output$tableset <- renderDataTable({ kable(spread_bole) %>% kable_styling(font_size = 15 ,bootstrap_options = c("striped","hover", "condensed")) }) tableOutput("tableset") 回答1: Since kable returns HTML, you can render your table using htmlOutput in ui

Adding multiple reactive plots and tables to Shiny app

坚强是说给别人听的谎言 提交于 2020-01-22 16:17:14
问题 I am working on a Shiny app and as I go I have been adding figures and tables in a haphazard way. I would like to have a better framework so that I can flexibly add reactive figures and tables to the output as it develops further. At the moment I have been using tabPanel and fluidrow to add additional a summary table and a second plot. However I have had trouble adapting this. For example I currently generate 3 plots but have only able to plot 2 at a time. Could anyone show me a way to modify

Uploading many files in Shiny

夙愿已清 提交于 2020-01-22 15:33:06
问题 I am developing an app that helps to organize and visualize many PDF documents by topic/theme. I can upload and read a single PDF but I have difficulty in reading multiple PDF documents. For single PDF document: ui.R --- fileInput('file1', 'Choose PDF File', accept=c('.pdf')) --- server.R -------- library(pdftools) ------- mypdf<-reactive({ inFile <- input$file1 if (is.null(inFile)){ return(NULL) }else{ pdf_text(inFile$datapath) } }) To upload multiple PDF files, I have to use multiple = TRUE

Shiny: how to create a confirm dialog box

喜夏-厌秋 提交于 2020-01-22 11:12:06
问题 I would like to ask if it is possible to have a confirm dialog box, consisting of two buttons, in shiny. Say, if I click a Delete button, then the dialog box pop up. User pick the choice and return. The app acts according to the user choice. 回答1: Update using sweetalertR #install_github("timelyportfolio/sweetalertR") library(shiny) library(sweetalertR) runApp(shinyApp( ui = fluidPage( actionButton("go", "Go"), sweetalert(selector = "#go", text = "hello", title = "world") ), server = function

Linking to a tab or panel of a shiny app

末鹿安然 提交于 2020-01-22 05:25:27
问题 How do I manage to link from a given shiny part to parts that are located on other tabs/panels? Update The solution I drafted below works for the explicit case of linking to tabs/panels (and that's what I asked for). However, I'd be interested to also know about more generic ways of linking parts of a shiny app. Example I'd like to link from panel A to panel B, but I'm not quite sure what I need to specify as an action when the action link in panel A is clicked. The value #tab-4527-2 came

Force shiny to render plot in loop

元气小坏坏 提交于 2020-01-21 05:25:47
问题 I have a shiny app that runs a simulation. The goal is to show the user the calculation steps in between as a plot. How do I force shiny to update the plot? An MWE would look like this library(shiny) server <- function(input, output, session) { # base plot as a placeholder output$myplot <- renderPlot(plot(1:1, main = "Placeholder")) # wait until the button is triggered observeEvent(input$run, { print("Do some calculations in 3 steps") for (i in seq_len(3)) { print("Do some calculations") # ..