library(dplyr) library(magrittr) library(purrr) library(tibble) library(jsonlite) library(dataAN) json_egalite <- fromJSON("http://data.assemblee-nationale.fr/static/openData/repository/CONSULTATIONS_CITOYENNES/EGALITE/EGALITE.json")
table_enquetes <- tibble( id = extract2(json_egalite, "id"), sexe = extract2(json_egalite, "sexe") ) %>% rownames_to_column(var = "id_enquete")
make_table_egalite_question(extract2(extract2(json_egalite, "questions"), 1)) %>% glimpse()
table_questions_reponses <- map_df(.x = extract2(json_egalite, "questions"), make_table_egalite_question, .id = "id_enquete")
table_questions_reponses %>% left_join(y = table_enquetes, by = "id_enquete")
library(readr) write_csv(table_enquetes, "../raw-data/table_egalites_enquetes.csv") write_csv(table_questions_reponses, "../raw-data/table_egalites_questions_reponses.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.