am trying to build simple R-Shiny web-app and an currently doing ui.R and am quite struggling on (selectinput) function, can any one help me pleas in this and this error comes to me when i run the code:
Error in normalizeChoicesArgs(choices, choiceNames, choiceValues) :
Please specify a non-empty vector for `choices` (or, alternatively, for both `choiceNames` AND `choiceValues`).
# Load libraries
library(shiny)
library(tidyverse)
#"United-States", "Canada", "Mexico", "Germany", "Philippines"
# Application Layout
shinyUI(
fluidPage(
br(),
titlePanel('Adult demographic analysis'),
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."),
fluidRow(
column(12,
wellPanel(selectInput(
inputId = 'country',
label = "Country",
multiple = TRUE,
choices =c("United-States", "Canada", "Mexico", "Germany", "Philippines"),
))
)),
# 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("age","hours_per_week"), # add radio buttons for continuous variables
radioButtons("histogram","boxplot") # add radio buttons for chart type
)),
column(9, plotOutput('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("education",'workclass','sex'), # add radio buttons for categorical variables
# checkboxInput() # add check box input for stacked bar chart option
)
),
column(9, plotOutput('p2')) # add plot output
)
)
)