A simple way to replicate this issue:
shinyApp(
ui = fluidPage(
textOutput(\"helloJohn\"),
br(),
textOutput(\"helloJacob\"),
br(),
tex
You can wrap what's in the for loop in local
and create a local variable name2
that receives name
.
for(name in c("John", "Jacob", "Joe")) {
local({
name2 <- name
output[[paste0("hello", name2)]] <- renderText({paste0("hello ", name2, "!")})
})
}
Additional info and inspiration for this answer here.