Created
October 5, 2018 14:27
-
-
Save skohari/419bbc8816c9f97a52d00dd04ff5c42e to your computer and use it in GitHub Desktop.
renderUI2.r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny)########################################################################## | |
ui <- fixedPage( | |
h2("Normal example"), | |
uiOutput("moreControls"), | |
uiOutput("moreControls1"), | |
uiOutput("test") | |
) | |
server <- function(input, output, session) { | |
output$moreControls <- renderUI({ | |
tagList( | |
sliderInput("n", "N", 1, 10, 4), | |
numericInput("nlabel1", "Label", 67) | |
) | |
}) | |
output$moreControls1 <- renderUI({ | |
tagList( | |
numericInput("nlabel1", "Label", input$n) | |
) | |
}) | |
output$test <- renderUI({ | |
lapply(1:input$n, function(val) { | |
numericInput(paste0("label", val, sep = ""), paste("label", val, sep = " "), val) | |
}) | |
}) | |
} | |
shinyApp(ui, server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment