mirror of
https://github.com/ArthurDanjou/ArtStudies.git
synced 2026-03-16 05:11:40 +01:00
- Created a new R script 'packages.R' to manage necessary packages for the Classification and Regression module. - Included a list of required packages and a function to install any missing packages. - Implemented loading of all packages and added a success message upon completion.
44 lines
836 B
R
44 lines
836 B
R
# Liste des packages nécessaires
|
|
packages <- c(
|
|
"tidyverse",
|
|
"rsample",
|
|
"scales",
|
|
"dplyr",
|
|
"tidyr",
|
|
"glue",
|
|
"corrplot",
|
|
"ggfortify",
|
|
"carData",
|
|
"car",
|
|
"MASS",
|
|
"ggplot2",
|
|
"DataExplorer",
|
|
"skimr",
|
|
"plotly",
|
|
"gridExtra",
|
|
"grid",
|
|
"rlang",
|
|
"caret",
|
|
"reshape2",
|
|
"class",
|
|
"ROCR",
|
|
"randomForest",
|
|
"fitdistrplus",
|
|
"hexbin",
|
|
"paletteer"
|
|
)
|
|
|
|
# Fonction pour installer les packages manquants
|
|
install_if_missing <- function(p) {
|
|
if (!require(p, character.only = TRUE)) {
|
|
install.packages(p, dependencies = TRUE)
|
|
}
|
|
}
|
|
|
|
# Application de la fonction sur toute la liste
|
|
invisible(sapply(packages, install_if_missing))
|
|
|
|
# Chargement de toutes les librairies
|
|
invisible(lapply(packages, library, character.only = TRUE))
|
|
|
|
message("Tous les packages ont été installés et chargés avec succès !") |