首页 > 解决方案 > 我在这个闪亮的仪表板 UI 代码中缺少什么?

问题描述

好的,所以我正在为一门课程开发一个闪亮的仪表板项目,它只是没有点击,我已经与工作人员交谈并完成并提出了建议的更正,关于它,它仍然没有点击。我不断收到错误消息,即存在未使用的参数,然后它将我的整个代码复制回给我。

所以项目开始了,我得到了这个基地

# Application Layout
shinyUI(
  fluidPage(
    br(),
    # TASK 1: Application title
    ...,
    p("Explore the difference between people who earn less than 50K and more than 50K. You can filter the data by country, then explore various demogrphic information."),

# TASK 2: Add first fluidRow to select input for country
fluidRow(
  column(12, 
         wellPanel(...)  # add select input 
         )
),

# TASK 3: Add second fluidRow to control how to plot the continuous variables
fluidRow(
  column(3, 
         wellPanel(
           p("Select a continuous variable and graph type (histogram or boxplot) to view on the right."),
           ...,   # add radio buttons for continuous variables
           ...    # add radio buttons for chart type
           )
         ),
  column(9, ...)  # add plot output
),

# TASK 4: Add third fluidRow to control how to plot the categorical variables
fluidRow(
  column(3, 
         wellPanel(
           p("Select a categorical variable to view bar chart on the right. Use the check box to view a stacked bar chart to combine the income levels into one graph. "),
           ...,    # add radio buttons for categorical variables
           ...     # add check box input for stacked bar chart option
           )
         ),
  column(9, ...)  # add plot output
    )
  )
)

我已经做到了这一点

    # Application Layout
shinyUI(
  fluidPage(
    br(),
    # TASK 1: Application title
    titlePanel(title = "Expectancy by Country"),
    p("Explore the difference between people who earn less than 50K and more than 50K. You can filter the data by country, then explore various demogrphic information.")),

# TASK 2: Add first fluidRow to select input for country
fluidRow(
  column(12, 
         wellPanel(selectInput(
           "country",
           "Select Country",
           choices = c("United-States", "Canada", "Mexico", "Germany", "Philippines")
         ))  # add select input 
         )
),

# TASK 3: Add second fluidRow to control how to plot the continuous variables
fluidRow(
  column(3, 
         wellPanel(
           p("Select a continuous variable and graph type (histogram or boxplot) to view on the right."),
           radioButtons("continous_variable",
                        "Variable",
                        choices = c("age", "hours_per_week")),   # add radio buttons for continuous variables
           radioButtons("graph_type",
                        "Select Graph Style",
                        choices = c("histogram", "boxplot"))    # add radio buttons for chart type
           )
         ),
  column(9, "p1")  # add plot output
),

# TASK 4: Add third fluidRow to control how to plot the categorical variables
fluidRow(
  column(3, 
         wellPanel(
           p("Select a categorical variable to view bar chart on the right. Use the check box to view a stacked bar chart to combine the income levels into one graph. "),
           radioButtons("categorical_variables",
                        "factors",
                        choices = c("education", "workclass", "sex")),    # add radio buttons for categorical variables
           checkboxInput("is_stacked", "select", value = FALSE, width = NULL)     # add check box input for stacked bar chart option
           )
         ),
  column(9, plotOutput("p2"))  # add plot output
    )
  )

**** 就在这里,原始代码显示了第三个右括号,但每当我把它放进去时,我都会立即收到错误警报,我不知道为什么。

标签: rshinyshinydashboard

解决方案


推荐阅读