Search a Kolada municipality metadata table. Only keep rows that contain the
search query. Note that some a quer might be both the name, or part of a
name, of a municipality and part of the name of a region. Thus, a search
might return rows for both municipalities and regions. To avoid this you can
use dplyr::filter to filter the type
column to keep only "K" (municipalities) or "L" (regions) rows. See also
examples below for an alternative approach avoiding any direct calls to
filter.
Examples
if (kolada_available()) {
# Search for a single search term in a municipality table
munic_df <- get_municipality()
municipality_search(munic_df, "Arboga")
# Only keep columns with type == "K" (keep municipalities, drop regions)
munic_filter <- get_municipality(cache = TRUE) %>%
municipality_search("K", column = "type")
}