var_args_list {nc} | R Documentation |
var args list
Description
Parse the variable-length argument list used in capture_first_vec
,
capture_first_df
, and capture_all_str
. This function is mostly
intended for internal use, but is useful if you want to see the
regex pattern generated by the variable argument syntax.
Usage
var_args_list(...)
Arguments
... |
character vectors (for regex patterns) or functions (which specify
how to convert extracted character vectors to other types). All
patterns must be character vectors of length 1. If the pattern is
a named argument in R, it becomes a capture |
Value
a list with two named elements
fun.list |
list of conversion functions with names corresponding to capture group(s) |
pattern |
regular expression string with capture group(s) |
Author(s)
Toby Hocking <toby.hocking@r-project.org> [aut, cre]
Examples
pos.pattern <- list("[0-9]+", as.integer)
nc::var_args_list(
chrom="chr.*?",
":",
chromStart=pos.pattern,
list(
"-",
chromEnd=pos.pattern
), "?")