Learn R Programming

rKolada (version 0.2.3)

kpi_grp_search: 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)

Value

A Kolada KPI Group metadata table

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.

Examples

Run this code
if (kolada_available()) {
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)
}

Run the code above in your browser using DataLab