Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204771

I have 140 renderUI elements to create. Is there a more efficient way?

$
0
0

I have a bit of renderUI code that created numeric input boxes and populates them from a list. it looks like this:

  output$Small1A <- renderUI({
    numericInput("Small1A","",min = 0, max = 100, value = Reduction()$Reduction[Reduction()$Category == "Small1A"])
    })

Reduction() is a list that is preloaded with some default values or can be loaded from a file. It looks like this

Category Reduction
Small1A  0.5
Small2A  0.5
...
Medium3D 0.5
...
Huge7E  7.4

there are 140 Elements (Small, Medium, Large, Huge) 1-7 and A-E

these are grouped on the UI as 5 collapsible boxes each with a 4x7 grid in.

 column(1, offset = 1, uiOutput("Small1A")),
 column(1, offset = 0, uiOutput("Small2A")),
(and so)

It seems like I should be able to replace the 140 renderUI statements with something neater, given the regularity of the source. How would you do this?


Viewing all articles
Browse latest Browse all 204771

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>