Select data

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) 

Tidy data

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)

Export data

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. /Users/runner/work/kwb.site/kwb.site/vignettes).

readr::write_csv2(projects_tidy, 
                  path = sprintf("projects_tidy_%s.csv", language))
#> Warning: The `path` argument of `write_csv2()` is deprecated as of readr 1.4.0.
#> Please use the `file` argument instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.