3
工作在RStudio罰款,但空使用下面rCharts:地塊閃亮的應用
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)
但是,閃亮的應用程序沒有渲染情節。它看起來是空的。任何建議,將不勝感激。
感謝您的時間和幫助。我使用你的代碼得到了這個錯誤 錯誤:未使用的參數(lib =「nvd3」)。 – aelwan
@aelwan:我使用命令安裝了rCharts:'require(devtools) install_github('ramnathv/rCharts')' –
非常感謝。現在工作正常。 – aelwan