Skip to contents

Higher-order function factory that creates get_ functions with automatic dispatch to handle single matrices, lists of matrices, and tibbles.

Usage

make_get_function(impl_fn, fn_name = NULL)

Arguments

impl_fn

Function. The implementation function that operates on a single matrix (nx2). Should accept x as first argument and ... for additional args.

fn_name

Character. Optional name for debugging (not used functionally).

Value

A function that dispatches based on input type.

Details

The returned function automatically:

  • Applies impl_fn to single matrices and returns the result

  • Applies impl_fn to each element of a list and returns a list

  • Applies impl_fn to tibble coo columns and EXTRACTS results (does not modify tibble)

For tibbles, get_* functions extract values for further processing by the user. They do NOT create new columns or modify the tibble.

Additional arguments are passed through via ...