Package: nc 2024.9.20

nc: Named Capture to Data Tables

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.

Authors:Toby Hocking [aut, cre]

nc_2024.9.20.tar.gz
nc_2024.9.20.zip(r-4.5)nc_2024.9.20.zip(r-4.4)nc_2024.9.20.zip(r-4.3)
nc_2024.9.20.tgz(r-4.4-any)nc_2024.9.20.tgz(r-4.3-any)
nc_2024.9.20.tar.gz(r-4.5-noble)nc_2024.9.20.tar.gz(r-4.4-noble)
nc_2024.9.20.tgz(r-4.4-emscripten)nc_2024.9.20.tgz(r-4.3-emscripten)
nc.pdf |nc.html
nc/json (API)
NEWS

# Install 'nc' in R:
install.packages('nc', repos = c('https://tdhock.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/tdhock/nc/issues

On CRAN:

7.00 score 17 stars 57 scripts 545 downloads 15 exports 1 dependencies

Last updated 2 months agofrom:7e2ac10e96. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 31 2024
R-4.5-winOKOct 31 2024
R-4.5-linuxOKOct 31 2024
R-4.4-winOKOct 31 2024
R-4.4-macOKOct 31 2024
R-4.3-winOKOct 31 2024
R-4.3-macOKOct 31 2024

Exports:alternativesalternatives_with_shared_groupsaltlistcapture_all_strcapture_first_dfcapture_first_globcapture_first_veccapture_longer_speccapture_melt_multiplecapture_melt_singlefieldgroupmeasurequantifiervar_args_list

Dependencies:data.table

Capture all matches in a single subject string

Rendered fromv2-capture-all.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-03-31
Started: 2019-09-04

Capture first match

Rendered fromv1-capture-first.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-03-31
Started: 2019-09-04

Capture melt

Rendered fromv3-capture-melt.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-03-31
Started: 2019-10-25

Comparisons with other packages

Rendered fromv4-comparisons.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-03-31
Started: 2019-10-25

Helper functions

Rendered fromv5-helpers.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-09-20
Started: 2021-05-11

Overview of nc functionality

Rendered fromv0-overview.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-09-20
Started: 2021-05-11

Reading regularly named files

Rendered fromv7-capture-glob.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-08-27
Started: 2024-01-05

Uniform interface to three regex engines

Rendered fromv6-engines.Rmdusingknitr::rmarkdownon Oct 31 2024.

Last update: 2024-03-31
Started: 2021-05-11

Readme and manuals

Help Manual

Help pageTopics
alternativesalternatives
alternatives with shared groupsalternatives_with_shared_groups
altlistaltlist
apply type funsapply_type_funs
Capture all matches in a single subject stringcapture_all_str
Capture first match in columns of a data framecapture_first_df
capture first globcapture_first_glob
Capture first match in each character vector elementcapture_first_vec nc
capture longer speccapture_longer_spec
Capture and melt into multiple columnscapture_melt_multiple
Capture and melt into a single columncapture_melt_single
check df namescheck_df_names
check namescheck_names
collapse somecollapse_some
Capture a fieldfield
Capture groupgroup
measuremeasure
measure multiplemeasure_multiple
measure singlemeasure_single
melt listmelt_list
only capturesonly_captures
quantifierquantifier
stop for capture same as idstop_for_capture_same_as_id
stop for enginestop_for_engine
stop for subjectstop_for_subject
subject var argssubject_var_args
try or stop print patterntry_or_stop_print_pattern
var args listvar_args_list