st_multiply_sgbp: Multiplies a sparse geometry binary predicate object (e.g....

View source: R/spatial_functions.R

st_multiply_sgbpR Documentation

Multiplies a sparse geometry binary predicate object (e.g. from sf::st_within) and a vector

Description

Performs sgbp %% mat, where sgbp is a 0/1 matrix. The main use case is when you want to sum a variable from points into a geometry. For example, sgbp %% rep(1, n) will give you the number within each geometry.

Usage

st_multiply_sgbp(sgbp, mat)

Arguments

sgbp

sgbp object from an sf function, e.g. sf::st_within

mat

Vector/Matrix you want to perform sgbp %*% mat.


kylebutts/kfbmisc documentation built on April 17, 2025, 5:20 p.m.