Résumé de section

    • Practical 1 Interactive visualisation with mtcars

      Objective Create a Shiny application to visualise the relationships between different variables in the mtcars dataset.

      Instructions

      1. Use selectInput() to allow the user to select two numerical variables from the mtcars dataset.
      2. Display an interactive scatter graph (ggplot2).
      3. Add a sliderInput() to adjust the size of the points.
      library(shiny)
      library(ggplot2)

      ui <- fluidPage(
        titlePanel("Visualisation interactive des données mtcars"),
          sidebarPanel(
            selectInput("xvar", "Choisissez la variable X :", choices = names(mtcars)),
            selectInput("yvar", "Choisissez la variable Y :", choices = names(mtcars)),
            sliderInput("pointSize", "Taille des points :", min = 1, max = 10, value = 3)
          ),
          mainPanel(
            plotOutput("scatterPlot"), width = 20)
      )

      server <- function(input, output) {
        output$scatterPlot <- renderPlot({
          ggplot(mtcars, aes_string(x = input$xvar, y = input$yvar)) +
            geom_point(size = input$pointSize, color = "blue") +
            theme_minimal() +
            labs(title = "Graphique de dispersion", x = input$xvar, y = input$yvar)
        })
      }

      shinyApp(ui, server)


      Practical 2 Analysing iris data

      Objective To enable the user to explore iris data using statistics and visualisations.

      Instructions

      1. Add a selectInput() to choose a species (setosaversicolorvirginica).
      2. Filter the data according to the selected species.
      3. Display :
        • statistical summary (summary()) of the numerical variables.
        • boxplot of the distribution of sepal lengths by species (ggplot2).
      library(shiny)
      library(ggplot2)

      ui <- fluidPage(
          sidebarPanel(
            selectInput("species", "Sélectionnez une espèce :", choices = unique(iris$Species))
          ),
          mainPanel(
            verbatimTextOutput("summaryStats"),
            plotOutput("boxplotSepalLength")
          )
      )

      server <- function(input, output) {
        filteredData <- reactive({
          iris[iris$Species==input$species,]
        })
        output$summaryStats <- renderPrint({
          summary(filteredData()[, 1:4])  # Exclure la colonne Species
        })
       
        output$boxplotSepalLength <- renderPlot({
          ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +
            geom_boxplot() +
            theme_minimal() +
            labs(title = "Longueur des sépales par espèce")
        })
      }

      shinyApp(ui, server)


      Practical 3 Analysis of the passengers on the Titanic (titanic from the datasets package)

      Objective To study the distribution of passengers according to class and survival.

      Instructions

      1. Load the dataset with data(‘Titanic’) and convert it to data.frame.
      2. Add checkboxGroupInput() to allow the user to filter passengers by class and gender.
      3. Display :
        • reactive array (DT::datatable()).
        • bar chart of the number of survivors and non-survivors (ggplot2).
      titanic_df <- as.data.frame(Titanic)

      ui <- fluidPage(
        titlePanel("Analyse des données Titanic"),
        sidebarLayout(
          sidebarPanel(
            checkboxGroupInput("class", "Choisir la classe :", choices = unique(titanic_df$Class), selected = unique(titanic_df$Class)),
            checkboxGroupInput("sex", "Choisir le sexe :", choices = unique(titanic_df$Sex), selected = unique(titanic_df$Sex))
          ),
          mainPanel(
            DTOutput("tableTitanic"),
            plotOutput("barPlotSurvival")
          )
        )
      )

      server <- function(input, output) {
        filteredData <- reactive({
          titanic_df %>%
            filter(Class %in% input$class, Sex %in% input$sex)
        })
       
        output$tableTitanic <- renderDT({
          datatable(filteredData())
        })
       
        output$barPlotSurvival <- renderPlot({
          ggplot(filteredData(), aes(x = Survived, y = Freq, fill = Survived)) +
            geom_bar(stat = "identity") +
            theme_minimal() +
            labs(title = "Répartition des survivants et non-survivants", x = "Survie", y = "Nombre de passagers")
        })
      }

      shinyApp(ui, server)

  • Submission deadline
    Friday 17 April 2026

    email GitHub repository

     

    SSD

     
    Groupe 1 : Mamy Rodrigue et Soumah Ousmane

    Groupe 2 : Bahraoui Ines et Bouaziz Chams-Eddine
    Groupe 3 : Daoudi Marouane
    Groupe 4 : Ben-Atmane Sofia et Camus Ines
    Groupe 5 : Benaissa Hadjer et El-Idrissi Myriam
    Groupe 6 : Karimou Firdaousse et Monmont Chloe
    Groupe 7 : Benameur Lea
    Groupe 8 : Jabri Mohammed
    Groupe 9 : Dahoud Aly et Remila Dalia
    Groupe 10 : Benameur Karam et El-Mahzoum Akram
    Groupe 11 : Assoumani Ben-Enfane et Maloum Ayoub
    Groupe 12 : Diagne Moussa et Agossou Dossou-Modeste
    Groupe 13 : Djossou Houenafa-Esperance-G
    Groupe 14 : Maggi Bastien et Regnat Neo
    Groupe 15 : Yonkeu-Waya Kevin-Roseverlt


    BIOINFO

    Groupe 1 : Morlevat Theo et Pariente Marie-Charlotte

    Groupe 2 : Hoang Thao-Anh et Lateur Axelle