st_any: Check for minimum and maximum occurences of 'TRUE' from a...

st_anyR Documentation

Check for minimum and maximum occurences of TRUE from a binary logical function.

Description

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).

Usage

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)

i %>%
  st_any() %>%
  head()

i %>%
  st_any(3, 10) %>%
  head()

j <- ngp %>%
  st_any_intersects(states_map)

head(j)

seasmith/sfx documentation built on April 1, 2024, 2:36 p.m.