From cf5007d0a169f673423e2c55920a48920001f078 Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Mon, 6 Mar 2017 15:30:36 +0100 Subject: [PATCH] Correction compte RSS manquants --- cloture.Rmd | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cloture.Rmd b/cloture.Rmd index 32ba875..a96e765 100644 --- a/cloture.Rmd +++ b/cloture.Rmd @@ -377,14 +377,16 @@ exhau %>% ```{r fig7} exhau_pims %>% mutate(mois_sortie = month(Sortie)) %>% - filter(!is.na(DP)) %>% + filter(is.na(DP)) %>% + distinct(RSS, .keep_all = T) %>% count(mois_sortie) %>% full_join(exhau_pims %>% mutate(mois_sortie = month(Sortie)) %>% + distinct(RSS, .keep_all = T) %>% count(mois_sortie), by = "mois_sortie") %>% - mutate(n = 100 * n.x / n.y, - n = ifelse(is.na(n), 100, n)) %>% + mutate(n = 100 * (n.y - n.x) / n.y) %>% + complete(mois_sortie = 1:mois, fill = list(n = 100)) %>% ggplot( aes(x = mois_sortie, @@ -406,14 +408,10 @@ exhau_pims %>% ```{r fig8} exhau_pims %>% mutate(mois_sortie = month(Sortie)) %>% - filter(!is.na(DP)) %>% + filter(is.na(DP)) %>% + distinct(RSS, .keep_all = T) %>% count(mois_sortie) %>% - full_join(exhau_pims %>% - mutate(mois_sortie = month(Sortie)) %>% - count(mois_sortie), - by = "mois_sortie") %>% - mutate(n = n.y - n.x, - n = ifelse(is.na(n), 0, n)) %>% + complete(mois_sortie = 1:mois, fill = list(n = 0)) %>% ggplot( aes(x = mois_sortie,