Load image or text in Shiny R -


i want make simple web app using r shiny load image harddrive giving path , displaying on webpage when button clicked.

i started doing text, example displaying path, button not react when click(i mean doesnt print message).

server.r:

shinyserver(function(input, output, session) {   dt<-reactive({   output$text1 <- rendertext({    paste("you have selected", input$obs)    })   })  }) 

ui.r:

shinyui(pagewithsidebar(   headerpanel("fruits , vegetables!"),   sidebarpanel(     helptext("what see below?"),     #imageoutput(outputid="images/1.png")     numericinput("obs", "number of observations view:", 10),     actionbutton("get", "get") ),   mainpanel(textoutput("text1")) )) 

with reactives, must wrap code that's using inputs in reactive block, must set output values outside of it. in case, example should be

 shinyui(pagewithsidebar(    headerpanel("fruits , vegetables!"),    sidebarpanel(      helptext("what see below?"),      #imageoutput(outputid="images/1.png")      numericinput("obs", "number of observations view:", 10),      actionbutton("get", "get")    ),    mainpanel(textoutput("text"))  )) 

 shinyserver(function(input, output, session) {    dt <- reactive({      paste("you have selected", input$obs)    })    output$text <- rendertext({ dt() })  }) 

to use imageoutput dynamically, should provide more information how want image url selected input.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -