kw_table_function <- function(cat_col,num_col,data,output) {
  
  kw_table = data.frame()
  
  tryCatch({
    krustal_formule <- as.formula(paste0(num_col,'~',cat_col))
    
    kruskal_test <- kruskal.test(krustal_formule,data=data)
    kw_table <- rbind(kw_table,c(num_col,cat_col,"KW",kruskal_test$p.value))
    colnames(kw_table) <-c("Column","Classe","Test","p-value")
    output$kw_resultat <- renderPrint({
      return(kruskal_test)
    })
  },
  error=function(e) {
    message('An Error Occurred')
    cat("Erreur :", conditionMessage(e), "\n")
    traceback()
  },
  warning=function(w) {
    message('A Warning Occured')
    print(w)
    kruskal_test <- kruskal.test(merged_data()[[col]]~interaction(merged_data()[[cat]], merged_data()[[cat_id()]]))
    kw_table <- rbind(kw_table,c(col,cat,"KW",kruskal_test$p.value))
    colnames(kw_table) <-c("Column","Classe","Test","p-value")
  })

}