Package 'kwb.site'

Title: R Package for Scraping Our Offical KWB Website (Before Re-Design in 2021)
Description: This package contains functions for scraping our official [KWB website](https://kompetenz-wasser.de). The data for all projects and people can be collected in order to provide an overview of the website`s content and in order to be integrate that data into a KWB knowledge repo.
Authors: Michael Rustler [aut, cre] (ORCID: <https://orcid.org/0000-0001-9134-2871>), FAKIN [fnd], Kompetenzzentrum Wasser Berlin gGmbH (KWB) [cph]
Maintainer: Michael Rustler <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-05-18 06:30:47 UTC
Source: https://github.com/KWB-R/kwb.site

Help Index


Helper function: Clean projects

Description

Helper function: Clean projects

Usage

clean_projects(projects_json)

Arguments

projects_json

projects_json (default: "https://kwb-r.github.io/kwb.site/projects.json")

Value

tibble with title and extracted project "id"


Helper function: extract funder ids

Description

Helper function: extract funder ids

Usage

extract_funder_ids(funder_logo_urls)

Arguments

funder_logo_urls

vector with funder urls

Value

vector with funder names


Helper function: Extract project IDs

Description

Helper function: Extract project IDs

Usage

extract_project_ids(title)

Arguments

title

project title (as retrieved by get_projects() function)

Value

tibble with title and extracted project "id"


Get Project

Description

Get Project

Usage

get_project(url, debug = TRUE)

Arguments

url

url of KWB project

debug

print debug messages (default: TRUE)

Value

tibble with project infos

Examples

url <- "https://www.kompetenz-wasser.de/en/project/flusshygiene/"
project_info <- get_project(url)
str(project_info)

Get Project URLs

Description

Get Project URLs

Usage

get_project_urls(language = "en", debug = TRUE)

Arguments

language

website language "en" (English) or "de" (German), default: "en"

debug

print debug messages (default: TRUE)

Value

character vector with project urls

Examples

project_urls_en <- get_project_urls("en")
head(project_urls_en)

## Not run: project_urls_de <- get_project_urls("de")
head(project_urls_de)

## End(Not run)

Get Projects Info (English and German)

Description

Get Projects Info (English and German)

Usage

get_projects(debug = TRUE)

Arguments

debug

print debug messages (default: TRUE)

Value

tibble with infos for all projects in English and German

Examples

## Not run: 
project_infos <- get_projects()
project_infos

## End(Not run)

Create KWB Projects Gant Chart

Description

Create KWB Projects Gant Chart

Usage

plot_gantt_chart_project(
  projects_json = "https://kwb-r.github.io/kwb.site/projects.json",
  tag_selection = "department",
  language_selection = "en",
  interactive = FALSE,
  interactive_export = FALSE,
  interactive_export_dir = ".",
  alpha = 0.5
)

Arguments

projects_json

default: "https://kwb-r.github.io/kwb.site/projects.json")

tag_selection

default: "department" (or "topic")

language_selection

default: "en" (or "de")

interactive

should interactive ploty be used (default: FALSE)

interactive_export

should interactive plotly graph exported? default: FALSE

interactive_export_dir

export directory in case of interactive = TRUE, default: "."

alpha

alpha (default: 0.5)

Value

KWB projects gant chart

Examples

## Not run: 
projects_by_department_en <- plot_project_gant_chart()
plot_project_gant_chart(interactive = TRUE)
projects_by_department_de <- plot_project_gant_chart(language_selection = "de")
projects_by_topic_en <- plot_project_gant_chart(tag_selection = "topic")
projects_by_topic_de <- plot_project_gant_chart(tag_selection = "topic", language_selection = "de")

## End(Not run)

Create KWB Projects by Funder Gantt Chart

Description

Create KWB Projects by Funder Gantt Chart

Usage

plot_gantt_chart_project_by_funder(
  projects_json = "https://kwb-r.github.io/kwb.site/projects.json",
  language_selection = "en",
  interactive = FALSE,
  interactive_export = FALSE,
  interactive_export_dir = ".",
  alpha = 0.5
)

Arguments

projects_json

default: "https://kwb-r.github.io/kwb.site/projects.json")

language_selection

default: "en" (or "de")

interactive

should interactive ploty be used (default: FALSE)

interactive_export

should interactive plotly graph exported? default: FALSE

interactive_export_dir

export directory in case of interactive = TRUE, default: "."

alpha

alpha (default: 0.5)

Value

KWB projects by funder gantt chart