You can achieve this with a grouped filter with any()
, such as:
plotData %>%
group_by(country) %>%
filter(any(rank <= 15)) %>%
ungroup()
You can achieve this with a grouped filter with any()
, such as:
plotData %>%
group_by(country) %>%
filter(any(rank <= 15)) %>%
ungroup()