I have a problem with error:
argument "mainPanel" is missing, with no default
I have search forum for similar problems, but I am beginner, so something trivial could be wrong.
The mainPanel is not missing also, commas are correct. Do you have any suggestions?
The csv files are available using this link: https://ufile.io/wknza
Please see code:
library(shiny)
library(fmsb)
library(ggplot2)
nba2 = read.csv("headerlivingconditionsPos.csv", header = TRUE, sep = ",")
nba = read.csv("livingconditions.csv", header = TRUE, sep = ",")
header = read.csv("headerlivingconditions.csv", header = TRUE, sep = ",")
nbaSelectAttributes = nba2
nbaSelectAttributes$COUNTRIES <- NULL
nbaSelectAttributes$TEAM <- NULL
nba2$X <- NULL
attributes <- attributes(nbaSelectAttributes)$names
countriesName = attributes(nba$COUNTRIES)$levels
teams = attributes(nba$TEAM)$levels
ui <- fluidPage(
  titlePanel("NBA Analysis Application"),
  navlistPanel(
    "Menu",
    tabPanel("COUNTRIES Comparison",
             sidebarLayout(
               sidebarPanel(
                 selectInput("country1", "Choose the first country:",
                             choices = countriesName),
                 selectInput("country2", "Choose the second contry:",
                             choices = countriesName),
                 column(12, 
                        checkboxGroupInput("checkGroup", 
                                           h3("Choose the stats that you want to compare (at least 3):"), 
                                           choices = list("Housing" = "HOUSING", 
                                                          "Income" = "INCOME", 
                                                          "Jobs" = "JOBS",
                                                          "Community" = "COMMUNITY",
                                                          "Education" = "EDUCATION",
                                                          "Environment" = "ENVIRONMENT",
                                                          "Civic Engagement " = "CIVIC ENGAGEMENT",
                                                          "Health   " = "HEALTH ",
                                                          "Life satisfaction" = "LIFE SATISFACTION",
                                                          "Safety" = "SAFETY",
                                                          "Work Life Balance" = "WORK LIFE BALANCE",
                                               selected = "JOBS"))
               ),
               mainPanel(
                 plotOutput("radarChart"),
                 p("Every variable is measured in scale of 0 to 10.")
               )
             )
    ),
    tabPanel("Info",
             fluidRow(
               shiny::column(6, offset = 0, h1("Probando"))
             )
    )
  )
),
server <- function(input, output) {
  output$radarChart <- renderPlot({
    nba$TEAM <- NULL
    pl1 <- subset(nba, COUNTRIES == input$country1)
    pl2 <- subset(nba, COUNTRIES == input$country2)
    merge1 <- rbind(header, pl1)
    merge2 <- rbind(merge1, pl2)
    ###
    datasetInput <- reactive({
      perm.vector <- as.vector(input$checkGroup)
      perm.vector
    }) 
    ###
    final = subset(merge2, select = c(input$checkGroup) )
    final$COUNTRIES <- NULL
    colors_border=c( rgb(0.2,0.5,0.5,0.9), rgb(0.8,0.2,0.5,0.9) , rgb(0.7,0.5,0.1,0.9) )
    colors_in=c( rgb(0.2,0.5,0.5,0.4), rgb(0.8,0.2,0.5,0.4) , rgb(0.7,0.5,0.1,0.4) )
    radarchart( final  , axistype=1 , 
                #custom polygon
                pcol=colors_border , pfcol=colors_in , plwd=4 , plty=1,
                #custom the grid
                cglcol="grey", cglty=1, axislabcol="grey", cglwd=0.8,
                #custom labels
                vlcex=0.8 
    )
    legend(x=1.5, y=1, legend = c(input$COUNTRIES1, input$COUNTRIES2), bty = "n", pch=20 , col=colors_in , text.col = "grey", cex=1.2, pt.cex=3)
    datasetInput
  })
}
)
shinyApp(ui = ui, server = server)
Thanks for help in advance!
 
    