Shiny

PickerInput label issue when inline is TRUE

折月煮酒 提交于 2021-02-08 06:06:22
问题 I have a r shiny app in which users have numerous choices they need to pick prior to plotting. In the pickerInput, the label text goes behind the choices. The code below library(shiny) library(shinydashboard) library(shinyWidgets) library(shinyjs) library(magrittr) library(dplyr) ui <- dashboardPage( dashboardHeader(title = "PickerInput Query", titleWidth=450), dashboardSidebar( width = 300, useShinyjs(), sidebarMenu(id = "tabs") ), dashboardBody( uiOutput('groupvar'), uiOutput('shapetype') )

shiny dynamically add input fields and data without getting re-rendered

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-08 04:45:26
问题 I'm trying to dynamically add new variables to my shiny app which is working but if I start editing one, the values (text and numeric) reset each time I then add an additional variable. This example works without needing a for loop using reactiveValuesToList() but when I apply it to my code, it doesn't work. Here is my working example: library(shiny) dist <- c("Normal", "Gamma") ui <- shinyUI(fluidPage( sidebarPanel( actionButton("add_btn", "Add Textbox"), actionButton("rm_btn", "Remove

shiny dynamically add input fields and data without getting re-rendered

余生长醉 提交于 2021-02-08 04:44:28
问题 I'm trying to dynamically add new variables to my shiny app which is working but if I start editing one, the values (text and numeric) reset each time I then add an additional variable. This example works without needing a for loop using reactiveValuesToList() but when I apply it to my code, it doesn't work. Here is my working example: library(shiny) dist <- c("Normal", "Gamma") ui <- shinyUI(fluidPage( sidebarPanel( actionButton("add_btn", "Add Textbox"), actionButton("rm_btn", "Remove

Read in cookie to Shiny application with embedded javascript

孤者浪人 提交于 2021-02-08 04:43:19
问题 I'm getting started with Shiny and loving it. But I've come upon a stumbling point with incorporating javascript in my Shiny applications to add on some additional functionality. Hoping to get some help. Here's a very basic Shiny application I'm using to test the feasibility of reading in a browser cookie with javascript so it can be accessed in ui.R. The ui.R code. # UI file of getCookie Shiny application. shinyUI(fluidPage( titlePanel('Cookie'), cookie <- tags$head(tags$script(src=

How to make actionButton only work when all inputs are given in R shiny?

无人久伴 提交于 2021-02-08 04:19:30
问题 Currently my actionButton is taking in user input through drop down lists, and then when the actionButton is pressed it outputs this to a csv file. However, if the user only inputs 2 out of the 5 drop down lists and presses the actionButton this will still go to the csv file. How can I make it so it only accepts the actionButton if all inputs are given? I am using observeEvent(). 回答1: if you use the packages shinyjs you can deactivate the button when not all inputs are given with something

Filter reactive data with button clicked on leaflet map popup

落花浮王杯 提交于 2021-02-08 03:50:16
问题 I have a shiny app that displays information to users. Each line represents a place, so you can use two selectInputs to filter data using specific city names and areas. I'm using reactive() to filter the data. The resulting data is displayed below with info boxes and a map showing the location of each place. The info boxes have an action button that, once clicked, displays only the marker corresponding to the box. I'm updating my map with leafletProxy . Also, in my map, I have makers with

Filter reactive data with button clicked on leaflet map popup

醉酒当歌 提交于 2021-02-08 03:49:39
问题 I have a shiny app that displays information to users. Each line represents a place, so you can use two selectInputs to filter data using specific city names and areas. I'm using reactive() to filter the data. The resulting data is displayed below with info boxes and a map showing the location of each place. The info boxes have an action button that, once clicked, displays only the marker corresponding to the box. I'm updating my map with leafletProxy . Also, in my map, I have makers with

Filter reactive data with button clicked on leaflet map popup

瘦欲@ 提交于 2021-02-08 03:48:13
问题 I have a shiny app that displays information to users. Each line represents a place, so you can use two selectInputs to filter data using specific city names and areas. I'm using reactive() to filter the data. The resulting data is displayed below with info boxes and a map showing the location of each place. The info boxes have an action button that, once clicked, displays only the marker corresponding to the box. I'm updating my map with leafletProxy . Also, in my map, I have makers with

Test whether any input in a set of numbered input objects in R Shiny is empty

爱⌒轻易说出口 提交于 2021-02-08 02:09:27
问题 Let's say I have created 10 selectInput dropdowns for a multi plot export and these selectInputs are called "xaxis_1", "xaxis_2", ..... , "xaxis_10" for a single 1 I can write: if(!is.null(input$xaxis_1)) { .... do stuff } to stop it running export when the user hasn't entered any name, and presses submit, to avoid crashes. A bit more general you can check this: if(!is.null(input[[paste('xaxis', i, sep = '_')]])) { ...} how can you write it elegantly so that 1 line of code checks whether ANY

Test whether any input in a set of numbered input objects in R Shiny is empty

怎甘沉沦 提交于 2021-02-08 02:08:11
问题 Let's say I have created 10 selectInput dropdowns for a multi plot export and these selectInputs are called "xaxis_1", "xaxis_2", ..... , "xaxis_10" for a single 1 I can write: if(!is.null(input$xaxis_1)) { .... do stuff } to stop it running export when the user hasn't entered any name, and presses submit, to avoid crashes. A bit more general you can check this: if(!is.null(input[[paste('xaxis', i, sep = '_')]])) { ...} how can you write it elegantly so that 1 line of code checks whether ANY