Aggregates the CPV codes collected by enrich_with_details() into a table:
one row per code (cpv_id) with its German label (cpv_name, via
cpv_labels()), the number of tenders it appears in (n_tenders) and the KWB
research group(s) it maps to (groups). Used as the "CPV" sheet of the report.
Usage
cpv_summary(
tenders,
cpv_map = tender_cpv_map(),
keywords = tender_keywords(),
labels = cpv_labels()
)Arguments
- tenders
A tibble with a
cpvcolumn (comma-separated CPV codes).- cpv_map
CPV-to-group mapping (default
tender_cpv_map()).- keywords
Keyword groups, for group display names (default
tender_keywords()).- labels
CPV code -> name lookup (default
cpv_labels()).
Value
A data.frame with columns cpv_id, cpv_name, n_tenders, groups,
sorted by descending frequency.
Examples
cpv_summary(data.frame(cpv = c("90700000-4, 90733000-4", "90700000-4")))
#> cpv_id cpv_name n_tenders
#> 1 90700000-4 Dienstleistungen im Umweltschutz 2
#> 2 90733000-4 Dienstleistungen im Zusammenhang mit Wasserverschmutzung 1
#> groups
#> 1 Regenwasser & Gewässer, Wasser & Risiko
#> 2 Regenwasser & Gewässer, Grundwasser