diff --git a/data-raw/explo_modelisation.R b/data-raw/explo_modelisation.R new file mode 100644 index 0000000000000000000000000000000000000000..64ea8b3abfd7582a34fd270898bdbdcd4def4693 --- /dev/null +++ b/data-raw/explo_modelisation.R @@ -0,0 +1,77 @@ + +library(magrittr) + +load("~/projets/data.nitrates/data-raw/explo_modelisation.RData") + +x <- data_ars_last_year %>% + dplyr::select( + ins_code_national, + plv_code, + plv_date, + plv_heure, + anl_date_fin_analyse, + anl_code, + ana_param_valeur_traduite + ) +x2 <- x %>% + dplyr::group_by(ins_code_national, plv_date) %>% + dplyr::count(name = "nb_analyse") %>% + dplyr::ungroup() %>% + dplyr::filter(nb_analyse > 1) # 4 obs +x3 <- x %>% + dplyr::group_by(ins_code_national, plv_date, plv_heure) %>% + dplyr::count(name = "nb_analyse") %>% + dplyr::ungroup() %>% + dplyr::filter(nb_analyse > 1) # 0 obs + +y <- nitrate_analyse_eso_last_year %>% + dplyr::select( + bss_id, + code_bss, + date_debut_prelevement, + resultat, + ) +y2 <- y %>% + dplyr::group_by(bss_id, date_debut_prelevement) %>% + dplyr::count(name = "nb_analyse") %>% + dplyr::ungroup() %>% + dplyr::filter(nb_analyse > 1) # 2 obs +y3 <- y %>% + dplyr::filter( + bss_id %in% c(unique(y2$bss_id)) & + date_debut_prelevement %in% c(unique(y2$date_debut_prelevement)) + ) # 4 obs : 4 valeurs différentes de resultat + +z <- nitrate_analyse_esu_last_year %>% + dplyr::select( + code_station, + date_prelevement, + heure_prelevement, + date_maj_analyse, + heure_analyse, + resultat + ) +z2 <- z %>% + dplyr::group_by(code_station, date_prelevement) %>% + dplyr::count(name = "nb_analyse") %>% + dplyr::ungroup() %>% + dplyr::filter(nb_analyse > 1) # 17 obs +z3 <- z %>% + dplyr::group_by(code_station, date_prelevement, heure_prelevement) %>% + dplyr::count(name = "nb_analyse") %>% + dplyr::ungroup() %>% + dplyr::filter(nb_analyse > 1) # 7 obs +z4 <- z %>% + dplyr::group_by(code_station, date_prelevement, heure_prelevement, resultat) %>% + dplyr::count(name = "nb_analyse") %>% + dplyr::ungroup() %>% + dplyr::filter(nb_analyse > 1) # 1 obs : 1 doublon + +save.image(file = "data-raw/explo_modelisation.RData") + + + + + + + diff --git a/data-raw/explo_modelisation.RData b/data-raw/explo_modelisation.RData new file mode 100644 index 0000000000000000000000000000000000000000..e4c37cbb5a2cd6648484d0def13de331b0668639 Binary files /dev/null and b/data-raw/explo_modelisation.RData differ