conditional RenderUI R shiny -


I have a problem with the render UI and I could not find a solution anywhere. Maybe I am asking the wrong question and there is a basic R problem more than a small problem.

I have a function in R, which will return a table or text based on input, so I have made both options in my server. This way:

  Output $ table & lt; - Renderette {(x <- function (y) print (x)}} output $ text & lt; - rendertext {(x <- function (y) print (x)}}  

If I put both outputs in the render UI then I always get an error output one The table is, in case of textOutput:

  Error: Argument 1 (type 'list') can not be controlled by 'cat'  

And

  error: none of the applicable 'xtable' applied to the object of class "character"  

if it is viceversa

My question is that the one to catch this error Is Rika and if one uses one I statement within the renderUI to display one of the rows? Thanks in advance and if you need I'm here to give you more details. Library (shiny) library (drsmooth) shinyServer (function (input, Output, session) {- Dataframe upload and input management goes here - output $ nlbcd <- renderTable ({nlbcd & lt; -nlbcd (dosecolumn = "dosage", targetcolumn = response (), cutoffdose = cut ( ), Data = data1 ()) print (nlbcd)} output $ nlbcdText & lt; - renderText ({nlbcd & lt; -nlbcd (dosecolumn = "dose", targetcolumn = reaction (), cutoffdose = cut (), data = Data1 ()) Print (nlbcd)} Production $ TB <- renderUI ({tableOutput ("nlbcd"), textOutput ("nlbcdText") ")

You have some problems, functions with different errors and explanations including classes with warning. A healthy example of what this function might have with You are encouraged to include TryCatch in your code:

ui.R

  shinyUI (pageWithSidebar (headerPanel ( "Drsmooth"), sidebarPanel (numericInput ("number", label = h3 ("select" cutoffdose ", value = 0)), mainPanel (verbatimTextOutput ('current')))  

Server. R

  Library (drsmooth) shinyServer (function (input, output, session) {output current $ & lt; - renderPrint ({dosage & lt; - input $ number tryCatch ( Different ((dolphin ("dosage" "MF_Log", cutoffdose = dosage, data = DRdata), error = function (e) {cat (different (conditionMessage (e))}}})})}  < / Pre> 

Sample output: with & lt; code & gt; cuttoffdose & lt; / code & gt; = 0

= 1.5 ">


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -