0

I'm trying to make an App for the project that I'm working on. My goal is to make it reactive so when you pick some option, or press a "Click When Done" button, the server adds widgets to the UI or makes changes to the background data.

I'm having trouble doing this because R won't let me refer to input types in the server if they are created in some other part of the server. For example, I make a button called "DataReady": actionButton("DataReady","Click When Done") This is in a section of the server and it appears when someone chooses one of the options in: radioButtons("choice", h3("Choose Tool"), choices = list("ANOVA with saved data", "Add new data", "Boxplot maker")) Which is in the regular UI.

I then try to make another widget appear from the server (with renderUI) but only after the button has been pressed: if (input$DataReady >0){...

R keeps giving me errors here because when it is loading the App, input$DataReady is NULL, which doesn't count as a boolean.

Is there something I can do here to make this work?

  • Correct, you can’t access variables you create in the server. Can’t you just create it in the UI? – Daniel_j_iii Jul 29 '20 at 17:53
  • But I don't want the widget that creates the variable to show up until a condition is met. Also, the variable is technically made in the UI with "renderUI." So it would work if I could get the app to open without the initial error. – Sam Ferraro Jul 29 '20 at 21:39
  • I'm a bit confused what you want to achieve. Please provide a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – starja Jul 30 '20 at 11:43

0 Answers0