【发布时间】:2014-12-31 17:00:13
【问题描述】:
我无法使用闪亮的应用程序来解决错误以创建条形图。显示的错误是未传递参数。代码如下。
Ui.R
shinyUI(fluidPage(
titlePanel("An Overview of my skillsets"),
sidebarLayout(
sidebarPanel(
selectInput("dataset", "Select Company",
choices = c("Accenture", "Auroch", "Quintiles", "Others")),
numericInput("obs", "Number of observations to view:", 10) ),
mainPanel(plotOutput(""))
)
))
服务器.R
library(shiny)
shinyServer(function(input, output) {
TechSkills <- c( "X", "Y", "Z", "A", "B", "C")
TS_ACC <-c(25,26,22,12,22,27)
TS_AUR <- c(8,6,7,5,4,7)
TS_QUIN <- c(12,12,14,24,17,27)
ACCENTURE=data.frame(TechSkills, TS_ACC)
AUROCH=data.frame(TechSkills, TS_AUR)
QUINTILES=data.frame(TechSkills, TS_QUIN)
datasetInput <- reactive({
switch(input$dataset,
"Accenture" = ACCENTURE,
"Auroch" = AUROCH,
"Quintiles" = QUINTILES,
"Others" =OTHERS)
})
output$dataset <- renderPlot({
barplot(data=dataset)
})
})
【问题讨论】: