0
首先之间切换,这是我Rshiny应用的剥离下来的骨架,用什么,我试图做(但没有):在Rshiny,renderPlot和renderText
ui <- shinyUI(fluidPage(
titlePanel("Player Self-Centered Rating"),
sidebarLayout(
sidebarPanel(
radioButtons("radio", label = h3("Chart Type"),
choices = list("RadarPlot" = 1,
"Separate Plots" = 2,
"Top/Bottom 5 Table" = 3),
selected = 1)
mainPanel(
plotOutput('radarPlot', width = 50),
textOutput("text2")
)
)
))
server <- shinyServer(function(input, output) {
if (input$radio %in% c(1,2)) {
output$radarPlot <- renderPlot({
ggplot(data, aes(x = reorder(names, -ft_per_min), y = ft_per_min, col = this_player, fill = this_player)) +
geom_bar(stat = "identity")
}
}, height = 800, width = 900)
}
else if(input$radio == 3) {
output$text2 <- renderText({
paste("print some text")
})
}
})
此使用,如果和方法如果/其他情况确定是否调用renderPlot或renderText不起作用。我得到这个错误:
Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
上午我遥远的什么,我想在这里做什么?任何关于什么是错误的想法,以及我是否需要这种反应式表达或将不会受到赞赏!
那么简单,非常感谢主席先生! – Canovice