A vectorised membership predicate built on country_groups().
Arguments
- x
A vector of country names or codes.
- group
A single group name (see
country_groups()).- origin
How to read
x(default"country.name").
Value
A logical vector the same length as x. A value origin cannot
resolve to an ISO code answers FALSE – the same as a country that is
genuinely outside the group – so run check_country_match() first if you
need to tell "not a member" from "not recognised".
Examples
in_group(c("France", "United States", "Japan"), "EU")
#> [1] TRUE FALSE FALSE
