r - shiny reactive if statement giving a "[1]" in output. how to remove this? -


i have shiny server code in have loop check whether user entered 9 or nothing. whenever user enters 9 or nothing output containing [1] aswell ""

if enter nothing output

[1]"" 

if enter 9 output is

[1]"you not working good" 

how avoid [1] double quotes?

below server.r code

library(shiny)  shinyserver(function(input, output) {  output$name <- rendertext({input$name})   output$whrs<-renderprint({ if (input$whrs == "") {   "" } else   if(input$whrs == 9)  {   "you not working good"  }   })  }) 

this should keep going:

library(shiny)  server <- function(input, output) {    output$whrs<-rendertext({     if (input$text == "") {       ""     } else         if(input$text == 9)  {         "you not working good"       }   })  }  ui <- shinyui(fluidpage(   sidebarlayout(     sidebarpanel(     ),     mainpanel(selectinput("text","enter text",choices=c("","1","9")),               textoutput("whrs"))   ) ))  shinyapp(ui = ui, server = server) 

you have not provided full code, , had faults in 1 have provided already, thats why have created small example should further.

first of should use rendertext rather renderprint --> thats why getting double quotes , [1], due print format.

enter image description here


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -