| tw_filter_first | R Documentation |
Same as tw_filter(), but consistently returns data frames with a single
row.
tw_filter_first(
search,
p,
q,
language = tidywikidatar::tw_get_language(),
response_language = tidywikidatar::tw_get_language(),
limit = 10,
include_search = FALSE,
wait = 0,
cache = NULL,
overwrite_cache = FALSE,
cache_connection = NULL,
disconnect_db = TRUE
)
search |
A data frame generated by |
p |
A character vector of length 1, a property. Must always start with the capital letter "P", e.g. "P31" for "instance of". |
q |
A character vector of length 1, a wikidata id. Must always start with the capital letter "Q", e.g. "Q5" for "human being". |
language |
Language to be used for the search. Can be set once per
session with |
response_language |
Language to be used for the returned labels and
descriptions. Corresponds to the |
limit |
Maximum numbers of responses to be given. |
include_search |
Logical, defaults to |
wait |
In seconds, defaults to 0. Time to wait between queries to Wikidata. If data are cached locally, wait time is not applied. If you are running many queries systematically you may want to add some waiting time between queries. |
cache |
Defaults to |
overwrite_cache |
Defaults to |
cache_connection |
Defaults to |
disconnect_db |
Defaults to |
A data frame with one row and three columns, id, label, and
description, filtered by the above criteria.
tw_search("Margaret Mead") %>%
tw_filter_first(p = "P31", q = "Q5")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.