---
title: "correction_interro.Rmd"
author: "Armelle de le Court"
date: "25/03/2021"
output: pdf_document
---

---
title: "Rapport interro"
author: "Armelle de le Court 30821800"
date: "25/03/2021"
output: pdf_document
---

## chargement des packages

chargez les données le package rWSBIM1207 et interroL

```{r setup, message=FALSE}
library(rWSBIM1207)
library(tidyverse)
data("interroL")
```

## Question 1 : boxplots

```{r q1, message=FALSE}
ggplot(interroL, aes(x = interro, y = result))+
  geom_boxplot()+
  facet_grid(gender ~ serie)
```

## Question 2 : moyenne interros dans les deux séries

```{r}
interroL %>% 
  group_by(serie, interro) %>% 
  summarise( m = mean(result, na.rm = TRUE))
```


## Question 3 : meilleure moyenne

```{r}
interroL %>% 
group_by(id) %>%
  summarise(m = mean(result, na.rm = TRUE)) %>%
  filter(m == max(m))
```


```{r}
interroL %>% 
  filter(id == "A36739") %>% 
  filter(!is.na(result)) %>% 
  nrow()
```



