owid_search | R Documentation |
This function searches for a vector of keywords within specified columns of an OWID catalog data frame. If no columns are specified, it searches all character and factor columns.
owid_search(data, keywords, columns = NULL)
data |
A data frame, typically obtained from owid_get_catalog. |
keywords |
A character vector of one or more keywords to search for. The search is case-insensitive. |
columns |
An optional character vector of column names to search within. If NULL (default), all character and factor columns are searched. |
A filtered data frame containing only rows that match at least one of the keywords in at least one of the specified columns.
# Get the OWID catalog
catalog <- owid_get_catalog()
# Search for climate or carbon in all text columns
owid_search(catalog, c("climate", "carbon"))
# Search only in the title column
owid_search(catalog, c("climate", "carbon"), c("title"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.