anova_table_function <- function(data,var_expliquee,var_explicatives,output) {
  tryCatch({
    form = as.formula(paste0(paste0(var_expliquee,"~"),paste(var_explicatives,collapse = "*")))
    mod = lm(as.formula(form),data=data)
    anova_table <- as.data.frame(Anova(mod))
    for (col in names(anova_table)) {
      if (is.numeric(anova_table[[col]])) {
        anova_table[[col]] <- round(anova_table[[col]], 3)
      }
    }
    output$anova_result <- renderPrint({return(Anova(mod))})
    return(anova_table)
  },
  error = function(e) {
    message('An Error Occurred')
    cat("Erreur :", conditionMessage(e), "\n")
    traceback()
    return(NULL)
  },
  warning = function(w) {
    message('A Warning Occured')
    print(w)
    return(a)
  })
  
}