Suppose I have the following code in server:
df%>%
ggvis(~ratio, ~height, fill = ~ps, key := ~id) %>%
layer_bars() %>%
bind_shiny('rds', 'ui_rds')
And the following in ui:
fluidRow( box(title = "RD",width = 6, ggvisOutput('rds')))
The question is if the name of the output is variable and change in time, How can I set this in ui?
In the other words, if the code of server would be like the following:
x <<- "some value which will be changed reactively"
df%>%
ggvis(~ratio, ~height, fill = ~ps, key := ~id) %>%
layer_bars() %>%
bind_shiny(x, paste('ui_',x))
What is supposed to be the code of ui?
I don't see why you would want to do this, but
renderUIis always a possibility to deal with dynamicIDs.In my example below, the
plot_idagument inggvis::bind_shinywill be created by atextInput.renderUI/uiOutputis used to "channel" the plot to a single id"plot_wrapped"As mentioned above tough, I suggest not to use dynamic IDs in
shinyunless it is really necessary.