knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Select either German (projects_de.json
) or English (projects_en.json
) JSON data file. In this example
the project information in German (de
) is selected.
library(tidyr) language <- "de" # "en" for English json_path <- sprintf("https://kwb-r.github.io/kwb.site/projects_%s.json", language) projects_clean <- kwb.site::clean_projects(json_path)
projects_tidy <- projects_clean %>% dplyr::select(title, subtitle, description, budget, date_start, duration_total_months, language, tags, contacts, partners, funders, downloads, press) %>% tidyr::unnest(tags) %>% tidyr::unnest(contacts) %>% tidyr::unnest(partners) %>% tidyr::unnest(funders) %>% tidyr::unnest(downloads) %>% tidyr::unnest(press)
Exports the data in a CSV file (with ; as separator) in the current working directory which can be retrieved by calling the function getwd()
(e.g. r getwd()
).
```r readr::write_csv2(projects_tidy, path = sprintf("projects_tidy_%s.csv", language)) ````
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.