我想创建一个使用闪亮的应用程序,动态地将图表添加到页面.它可能是10个地块,它可能只有一个.我在闪亮的主页中使用本教程来获取动态UI.
这是一个简化的例子.该函数showme正在绘制图形
shinyServer(function(input, output) {
# Create an environment for storing data
symbol_env <- new.env()
# Make a chart for a symbol, with the settings from the inputs
make_chart <- function(symbol) {
showme(symbol)
}
display <- c("1083484" , "1101732")
output$MyList <- renderUi({
for (i in i:nrow(display))
renderPlot({make_chart(display[i])})
})
})
Run Code Online (Sandbox Code Playgroud)
shinyUI(pageWithSidebar(
headerPanel("My Plots !"),
sidebarPanel(
wellPanel(
p(strong("Scan1"))))
,mainPanel(
uiOutput("MyList")
)))
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
Listening on port 8100
Error in .subset2(x, "impl")$defineOutput(name, value, deparse(substitute(value))) :
Unexpected character output …Run Code Online (Sandbox Code Playgroud)