Learn R Programming

⚠️There's a newer version (2025.3.24) of this package.Take me there.

nc (version 2025.1.21)

Named Capture to Data Tables

Description

User-friendly functions for extracting a data table (row for each match, column for each group) from non-tabular text data using regular expressions, and for melting columns that match a regular expression. Patterns are defined using a readable syntax that makes it easy to build complex patterns in terms of simpler, re-usable sub-patterns. Named R arguments are translated to column names in the output; capture groups without names are used internally in order to provide a standard interface to three regular expression 'C' libraries ('PCRE', 'RE2', 'ICU'). Output can also include numeric columns via user-specified type conversion functions.

Copy Link

Version

Install

install.packages('nc')

Monthly Downloads

422

Version

2025.1.21

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Toby Hocking

Last Published

January 21st, 2025

Functions in nc (2025.1.21)

capture_first_vec

Capture first match in each character vector element
capture_melt_multiple

Capture and melt into multiple columns
alternatives_with_shared_groups

alternatives with shared groups
capture_first_glob

capture first glob
capture_all_str

Capture all matches in a single subject string
collapse_some

collapse some
check_names

check names
field

Capture a field
capture_melt_single

Capture and melt into a single column
group

Capture group
stop_for_subject

stop for subject
melt_list

melt list
quantifier

quantifier
stop_for_engine

stop for engine
measure_multiple

measure multiple
stop_for_capture_same_as_id

stop for capture same as id
measure

measure
measure_single

measure single
subject_var_args

subject var args
only_captures

only captures
check_df_names

check df names
try_or_stop_print_pattern

try or stop print pattern
var_args_list

var args list
apply_type_funs

apply type funs
altlist

altlist
alternatives

alternatives
capture_first_df

Capture first match in columns of a data frame
capture_longer_spec

capture longer spec