Actualiser app.R
This commit is contained in:
parent
9f1e49a248
commit
275f4b4ef8
52
app.R
52
app.R
|
@ -69,19 +69,9 @@ comparisonGraph = function(emmeansObj, prefix="hypothèse", groupe=T){
|
||||||
|
|
||||||
ui <- fluidPage(
|
ui <- fluidPage(
|
||||||
useShinyjs(),
|
useShinyjs(),
|
||||||
|
|
||||||
|
|
||||||
# Ici on empêche l'utilisateur de pouvoir rafraîchir la page accidentellement
|
|
||||||
tags$script('
|
|
||||||
window.onbeforeunload = function() {
|
|
||||||
return "Voulez-vous vraiment quitter cette page ?";
|
|
||||||
};
|
|
||||||
'),
|
|
||||||
|
|
||||||
|
|
||||||
#theme = shinytheme("readable"),
|
#theme = shinytheme("readable"),
|
||||||
navbarPage(
|
navbarPage(
|
||||||
"Stat Plateform",
|
"StatPlat",
|
||||||
tabPanel("Accueil",
|
tabPanel("Accueil",
|
||||||
fluidRow(
|
fluidRow(
|
||||||
column(4,
|
column(4,
|
||||||
|
@ -173,15 +163,17 @@ ui <- fluidPage(
|
||||||
fluidRow(
|
fluidRow(
|
||||||
column(4,
|
column(4,
|
||||||
wellPanel(
|
wellPanel(
|
||||||
selectizeInput("khi2_cat","Choisir les variables",multiple = TRUE,choices = NULL),
|
selectizeInput("khi2_x","Choisir une variable",multiple = FALSE,choices = NULL),
|
||||||
|
selectizeInput("khi2_y","Choisir une autre variable",multiple = FALSE,choices = NULL),
|
||||||
actionButton("khi2_button", "KHI2",class="btn-primary")
|
actionButton("khi2_button", "KHI2",class="btn-primary")
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
column(8,
|
column(8,
|
||||||
wellPanel(
|
wellPanel(
|
||||||
style = 'overflow-x: scroll;height: 650px;',
|
#style = 'overflow-x: scroll;height: 650px;',
|
||||||
DT::dataTableOutput("khi2_table"),
|
#DT::dataTableOutput("khi2_table"),
|
||||||
downloadButton("khi2_button_download", "Télécharger le tableau",class="btn-primary")
|
verbatimTextOutput("khi2_result")
|
||||||
|
#downloadButton("khi2_button_download", "Télécharger le tableau",class="btn-primary")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -207,14 +199,7 @@ ui <- fluidPage(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
tabPanel("Instructions",
|
|
||||||
fluidRow(
|
|
||||||
column(8,
|
|
||||||
includeMarkdown("README.md")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
navbarMenu("Régressions",
|
navbarMenu("Régressions",
|
||||||
tabPanel("ACP",
|
tabPanel("ACP",
|
||||||
column(3,
|
column(3,
|
||||||
|
@ -267,7 +252,8 @@ server <- function(input, output, session) {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
# Partie permettant de fusionner les fichiers
|
||||||
|
observe({
|
||||||
merged_data <- eventReactive(input$files, {
|
merged_data <- eventReactive(input$files, {
|
||||||
# On lit la liste des fichiers et on les fusionne
|
# On lit la liste des fichiers et on les fusionne
|
||||||
# Charger les données à partir des fichiers sélectionnés
|
# Charger les données à partir des fichiers sélectionnés
|
||||||
|
@ -397,10 +383,10 @@ server <- function(input, output, session) {
|
||||||
choices = colnames( merged_data_type() %>% select_if(function(x) is.numeric(x) || is.integer(x))))
|
choices = colnames( merged_data_type() %>% select_if(function(x) is.numeric(x) || is.integer(x))))
|
||||||
updateSelectInput(session, "var_explicatives_kw",
|
updateSelectInput(session, "var_explicatives_kw",
|
||||||
choices = colnames( merged_data_type() %>% select_if(function(x) is.factor(x))))
|
choices = colnames( merged_data_type() %>% select_if(function(x) is.factor(x))))
|
||||||
updateSelectInput(session, "khi2_cat",
|
updateSelectInput(session, "khi2_x",
|
||||||
|
choices = colnames( merged_data_type() %>% select_if(function(x) is.factor(x))))
|
||||||
|
updateSelectInput(session, "khi2_y",
|
||||||
choices = colnames( merged_data_type() %>% select_if(function(x) is.factor(x))))
|
choices = colnames( merged_data_type() %>% select_if(function(x) is.factor(x))))
|
||||||
updateSelectInput(session, "khi2_num",
|
|
||||||
choices = colnames( merged_data_type() %>% select_if(function(x) is.numeric(x) || is.integer(x))))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
#On utilise une fonction permettant d'obternir la liste des variables numériques
|
#On utilise une fonction permettant d'obternir la liste des variables numériques
|
||||||
|
@ -622,6 +608,17 @@ server <- function(input, output, session) {
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
khi2_table_calc <- eventReactive(input$khi2_button,{
|
||||||
|
x <- input$khi2_x
|
||||||
|
y <- input$khi2_y
|
||||||
|
merged_data <- merged_data_type()
|
||||||
|
khi2_table <- table(merged_data[,x],merged_data[,y])
|
||||||
|
res <- chisq.test(khi2_table)
|
||||||
|
return(res)
|
||||||
|
})
|
||||||
|
|
||||||
|
output$khi2_result <- renderPrint(khi2_table_calc())
|
||||||
|
|
||||||
|
|
||||||
anova_table <- eventReactive(input$anova_button,{
|
anova_table <- eventReactive(input$anova_button,{
|
||||||
tryCatch({
|
tryCatch({
|
||||||
|
@ -924,6 +921,7 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
#output$pls_text <- renderText({'print'})
|
#output$pls_text <- renderText({'print'})
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
shinyApp(ui, server)
|
shinyApp(ui, server)
|
Loading…
Reference in New Issue