The reactive user interface example – ui.R

The ui.R file merely needs to point to the reactive definition, as shown in the following line of code (just add it to the list of widgets within sidebarPanel()):

uiOutput("yearSelectorUI") 

You can now point to the value of the widget in the usual way, as input$yearSelector

There are more advanced things you can do with a reactive UI using the insertUI() and removeUI() functions, which allow you to insert arbitrary controls or sets of controls and remove controls, respectively. Although they are quite simple to actually produce, making use of them is quite tricky because of the need to keep track of the names given to each input, as well as which have been added and removed so far. As a consequence, we will not look at an example in this book; see the documentation for a simple example and you may wish to bear in mind that it is possible should you ever need it in a large application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset