Converts a logical matrix into a more manageable logical vector. Each row of the logical matrix must meet the min and max TRUE threshold (1 and Inf by default, respectively).

st_any(x, at_least = 1L, at_most = Inf)

Arguments

x

(sgbp/matrix) Return object of a simple feature binary logical function.

at_least

(integer) Minimal occurences of TRUE. Default is 1L.

at_most

(integer) Maximum occurences of TRUE. Default is Inf.

Examples

library(sf) data(ngp) data(states_map) i <- ngp %>% st_intersects(states_map)
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
i %>% st_any() %>% head()
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE
i %>% st_any(3, 10) %>% head()
#> [1] FALSE FALSE FALSE FALSE FALSE FALSE
j <- ngp %>% st_any_intersects(states_map)
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
head(j)
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE