Shiny

if statement get rid of: Error in if: argument is of length zero

陌路散爱 提交于 2020-01-24 21:16:27
问题 The idea Depending on selectizeInput() input I want to display one row of data from a data frame. However, some variables are only to be displayed if their value is not FALSE . selectizeInput() includes a placeholder prompt, which is highly desirable. The problem The code I developed actually works but until any option is selected displays Error in if: argument is of length zero inside the app, which is highly undesirable. Example code library("shiny") # simulate data data <- data.frame( name

if statement get rid of: Error in if: argument is of length zero

*爱你&永不变心* 提交于 2020-01-24 21:15:34
问题 The idea Depending on selectizeInput() input I want to display one row of data from a data frame. However, some variables are only to be displayed if their value is not FALSE . selectizeInput() includes a placeholder prompt, which is highly desirable. The problem The code I developed actually works but until any option is selected displays Error in if: argument is of length zero inside the app, which is highly undesirable. Example code library("shiny") # simulate data data <- data.frame( name

R Shiny - Updating the value of a selectInput and progressBar simultaneously

流过昼夜 提交于 2020-01-24 20:35:28
问题 The app below contains an actionButton , a shinyWidgets::progressBar and a selectInput : When the Start button is clicked, an observeEvent is triggered in which I loop through the numbers 1-10 and increment the progress bar at each iteration. I would also like to update the value of the selectInput at each iteration but updateSelectInput does not work as expected. Instead of updating in tandem with the progress bar, the selectInput value is only updated once the loop has terminated. I don't

How to change the width and height of verbatimTextOutput in Shiny and Shinydashboard

最后都变了- 提交于 2020-01-24 20:00:06
问题 In this example, I would like to make the width of the height of the verbatimTextOutput ( Text output no.1 ) as the same as the textInput ( Text input no.1 ). My ultimate goal is to make the appearance of the textInput and verbatimTextOutput completely the same. To achieve this, I have asked several questions as how to change the corner angle (Why shinydashboard changes the corner of a numericInput from round to 90 degree?), and how to change the font family of verbatimTextOutput (How to

Unable to use reactive element in my shiny app

爱⌒轻易说出口 提交于 2020-01-24 17:04:48
问题 In my shiny app,I want to change the ggplot barChart that I wish to construct. selectinput should allow to change the month (see dataset below) and so my plot should change accordingly. problem : The isssue is, i am unable to use my reactive function or even just simple input$monthid within ggplot function. Dataset: Month Orders 1 Feb 984524 2 Jan 1151303 3 Mar 575000 > dput(b) structure(list(Month = c("Feb", "Jan", "Mar"), Orders = c(984524L, 1151303L, 575000L)), .Names = c("Month", "Orders"

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

一世执手 提交于 2020-01-24 15:31:45
问题 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>'))

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>'))

R Shiny: name tabPanel with the number of clicks

本小妞迷上赌 提交于 2020-01-24 15:30:26
问题 I'm creating an app in which the user can create new tabPanels by clicking on a tabPanel dedicated to it. I know how to do so, but I don't know how to name tabPanels with a reactive number in it. To be clearer, here's a reproducible example: library(shiny) library(shinyWidgets) ui <- navbarPage(position = "static-top", title = "foo", id = "tabs", tabPanel(title = "Name 1", fluidRow()), tabPanel(title = "More", icon = icon("plus"), fluidRow() ) ) server <- function(input, output) { count <-

R Shiny: refreshing/overriding actionButton() output

雨燕双飞 提交于 2020-01-24 14:33:21
问题 I am trying to adapt R Shiny: automatically refreshing a main panel without using a refresh button to a new minimal working example: ui <- fluidPage( pageWithSidebar( headerPanel("actionButton test"), sidebarPanel( numericInput("n", "N:", min = 0, max = 100, value = 50), br(), actionButton("goButton", "Go!"), p("Click the button to update the value displayed in the main panel."), actionButton("newButton", "New Button"), actionButton("newButton2", "Another New Button") ), mainPanel(

Drawing rectangles on top of image R shiny

六月ゝ 毕业季﹏ 提交于 2020-01-24 12:57:04
问题 I'd like to elaborate on the accepted answer to this question. I'm looking at improving the minimal shiny app below (extracted from the accepted answer) with the following features: 1) draw the rectangle + a text label . The label comes from R ( input$foo ), e.g., from a dropdown. To avoid the edge cases where the labels fall outside the images, labels should be placed inside their rectangles. 2) use a different color for the rectangles and their labels depending on the label 3) ability for