Determines the top-tier (tier = 1L) or second-tier (tier = 2L) topics corresponding to topics in the
hierarchy, i.e. either topics themselves or their (grand)parent topics.
See also
Other referendum topic functions:
data_topics,
hierarchize_topics(),
hierarchize_topics_fast(),
topics()
Examples
rdb::infer_topics(topics = c("EU", "animal protection"),
tier = 1L)
#> [1] "foreign policy" "environment and living space"
rdb::infer_topics(topics = c("EU", "animal protection"),
tier = 2L)
#> [1] "European policy" "environment"
# topics of different tiers can mixed in `topics`
rdb::infer_topics(topics = c("EU", "environment"),
tier = 2L)
#> [1] "European policy" "environment"
# but `topics` of a higher tier than `tier` will be ignored
rdb::infer_topics(topics = "foreign policy",
tier = 2L)
#> character(0)