Pour faciliter l'usage des données de consultations sur les institutions, ce script R permet de générer un fichier au format tabulaire.
library(listviewer) library(rvest) library(purrr) library(tibble) library(magrittr) library(dataAN) library(readr) library(xml2)
list_institutions <- read_xml(x = "http://data.assemblee-nationale.fr/static/openData/repository/CONSULTATIONS_CITOYENNES/INSTITUTIONS/Institutions.xml") %>% as_list()
tibble( titre_theme = map_chr(map(list_institutions$themes, .f = "titre"), 1) )
make_reponses_table(x = list_institutions$themes[[1]]$questions[[1]]) %>% glimpse()
make_questions_reponses_table(x = list_institutions$themes[[1]]) %>% glimpse()
map_df(.x = list_institutions$themes, make_questions_reponses_table)
table_questions_reponses <- map_df(.x = list_institutions$themes, make_questions_reponses_table) write_csv(table_questions_reponses, path = "../raw-data/institutions.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.