inst/my_app/ui.R

library(tidyr)
library(nbafuns)
library(corrplot)
library(shiny)
library(dplyr)
library(ggplot2)
library(FactoMineR)
library(factoextra)
ui <-
  navbarPage(
    "NBA STA101",
    tabPanel("Data",
             fluidPage(
               sidebarLayout(
                 sidebarPanel(
                   nbaDataInput("nbafuns"),
                   verbatimTextOutput("log"),
                   nbaDataUI("nbafuns")
                 ),
                 mainPanel(
                   h3("Data table"),
                   dataTableOutput("table_1")


                 )
               )
             )
    ),
    tabPanel("Bivariate Stats",
             fluidPage(
               sidebarLayout(
                 sidebarPanel(
                   uiOutput("select_input_ui_1"),
                   uiOutput("select_input_ui_2"),
                   uiOutput("select_input_ui_3"),
                   selectInput("select_input_test", label = h3("Select a test method"),
                               choices = list("Pearson test" = "pearson", "Spearman" = "spearman"),
                               selected = 1),
                   verbatimTextOutput("message_6"),
                   verbatimTextOutput("message_7")
                 ),
                 mainPanel(
                   h3("Scatter plot"),
                   plotOutput("scatter_plot_1"),
                   verbatimTextOutput("pearson_1")
                 )
               )
             )
    ),
    tabPanel("Screeplot",
             fluidPage(
               sidebarLayout(
                 sidebarPanel(
                   radioButtons("radio_1", label="Choose",
                                choices = list("Variance" = "variance",
                                               "Eigen value" = "eigenvalue"))
                   # verbatimTextOutput("message_1"),
                   # verbatimTextOutput("message_2"),
                   # verbatimTextOutput("message_3")
                 ),
                 mainPanel(
                   plotOutput("screeplot_1"),
                   dataTableOutput("table_2")

                 )
               )
             )
    ),
    tabPanel("Variables",
             fluidPage(
               sidebarLayout(
                 sidebarPanel(
                   radioButtons("radio_2", label="Choose",
                                choices = list("Coordinates of the variables" = 1,
                                               "Correlations between variable and dimensions" = 2,
                                               "Cos2 for the variables" = 3,
                                               "Contribtutions of the variables" = 4)),
                   sliderInput("slider_1", label = h3("Select a dimension"), min = 1,
                               max = 10, value=c(1,2)),
                   verbatimTextOutput("message_4"),
                   plotOutput("corrplot_2")
                 ),
                 mainPanel(
                   h3("Correlation circles"),
                   plotOutput("circle_1", width = "100%", height = "400px"),
                   h3("Quality of representation"),
                   fluidRow(plotOutput("corrplot_1")),
                   h3("Table of values"),
                   dataTableOutput("table_3")
                 )
               )
             )
    ),
    tabPanel("Individuals",
             fluidPage(
               sidebarLayout(
                 sidebarPanel(
                   sliderInput("slider_2", label = h3("Select a dimension"), min = 1,
                               max = 10, value=c(1,2)),
                   verbatimTextOutput("message_5"),
                   uiOutput("select_input_ui_4")
                 ),
                 mainPanel(
                   h2("Graph of individuals"),
                   plotOutput("plot_ind_1"),
                   h2("Biplot"),
                   plotOutput("biplot_1"),
                   plotOutput("plot_ind_2"),
                   plotOutput("plot_ind_3")
                 )
               )
             )
    )

  )
thierrycnam/nbafuns documentation built on Sept. 30, 2019, 1:41 p.m.