【发布时间】:2016-04-18 03:56:36
【问题描述】:
使用下面的代码
library(shiny)
library(rCharts)
hair_eye_male <- subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair,
group = "Eye",
data = hair_eye_male,
type = 'multiBarChart')
n1
我在 RStudio 中得到了这个情节
我想为这个情节创建一个闪亮的应用程序。我使用下面的代码创建了应用程序
library(shiny)
library(rCharts)
ui <- fluidPage(
mainPanel(uiOutput("tb")))
server <- function(input,output){
output$hair_eye_male <- renderChart({
hair_eye_male <- subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair, group = "Eye", data = hair_eye_male,
type = 'multiBarChart')
return(n1)
})
output$tb <- renderUI({
tabsetPanel(tabPanel("First plot",
showOutput("hair_eye_male")))
})
}
shinyApp(ui = ui, server = server)
但是,闪亮的应用程序没有渲染情节。它看起来是空的。任何建议将不胜感激。
【问题讨论】: