apply_type_funs {nc}R Documentation

apply type funs

Description

Convert columns of match.mat using corresponding functions from fun.list, then handle any duplicate capture group names.

Usage

apply_type_funs(match.mat, 
    fun.list)

Arguments

match.mat

Character matrix (matches X groups).

fun.list

Named list of functions to apply to captured groups. If there are any duplicate names, they must be in alternatives (only one match per unique group name, otherwise error).

Value

data.table with columns defined by calling the functions in fun.list on the corresponding column of match.mat. Even if fun.list has duplicated names, the output data.table will have unique column names (identically named capture groups in alternatives will be combined into a single output column).

Author(s)

Toby Hocking <toby.hocking@r-project.org> [aut, cre]


[Package nc version 2024.2.21 Index]