kpi_grp_search: Search a Kolada KPI Group metadata table for group names

View source: R/kpi_groups.R

kpi_grp_searchR Documentation

Search a Kolada KPI Group metadata table for group names

Description

Search a Kolada KPI Group metadata table. Only keep rows that contain the search query. Searches group titles and group IDs. Note that this function does not search for individual KPIs contained within KPI groups! To search for KPIs within a KPI group, see examples below for an example using kpi_grp_unnest.

Usage

kpi_grp_search(kpi_grp_df, query)

Arguments

kpi_grp_df

A Kolada KPI Group metadata table, as created by e.g. get_kpi_groups.

query

A search term or a vector of search terms to filter by. Case insensitive.

Value

A Kolada KPI Group metadata table

Examples

kpi_grp_df <- get_kpi_groups()

# Which KPI groups match the keyword "ekonomi" (economy)?
kpi_grp_df %>% kpi_grp_search("ekonomi")

# Which KPI groups contain KPIs matching the keyword "arbete" (work/labour)?
kpi_grp_df %>%
  kpi_grp_unnest() %>%
  kpi_search("arbete") %>%
  dplyr::count(group_title, sort = TRUE)


rKolada documentation built on March 18, 2022, 5:07 p.m.