Skip to content

Commit

Permalink
intro in overview
Browse files Browse the repository at this point in the history
  • Loading branch information
tdhock committed Mar 31, 2024
1 parent a5aab7e commit 487f89b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 21 deletions.
25 changes: 18 additions & 7 deletions vignettes/v0-overview.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,37 @@ vignette: >
\usepackage[utf8]{inputenc}
---

# Overview of nc functionality

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

Here is an index of topics which are explained in the different
`nc` is a package for named capture regular expressions (regex), which
are useful for parsing/converting text data to tabular data (one row
per match, one column per capture group). In the terminology of regex,
we attempt to match a regex/pattern to a subject, which is a string of
text data. The regex/pattern is typically defined using a single
string (in other frameworks/packages/languages), but in `nc` we use a
special syntax: one or more R arguments are concatenated to define a
regex/pattern, and named arguments are used as capture groups. For
more info about regex in general see
[regular-expressions.info](https://www.regular-expressions.info/reference.html)
and/or the [Friedl book](http://regex.info/book.html), and for more
info about the special `nc` syntax, see `help("nc",package="nc")`.

Below is an index of topics which are explained in the different
vignettes, along with an overview of functionality using simple
examples.

## Capture first match in several subjects

[Capture first](v1-capture-first.html) is for the situation when your
input is a character vector (each element is a different subject), you
want find the first match of a regex to each subject, and your desired
output is a data table (one row per subject, one column per capture
group in the regex).
input is a character vector (each element is a different subject to
parse), you want find the first match of a regex to each subject, and
your desired output is a data table (one row per subject, one column
per capture group in the regex).

```{r}
subject.vec <- c(
Expand Down
2 changes: 0 additions & 2 deletions vignettes/v1-capture-first.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ vignette: >
\usepackage[utf8]{inputenc}
---

# Capture first match

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down
2 changes: 0 additions & 2 deletions vignettes/v2-capture-all.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ knitr::opts_chunk$set(
)
```

# Capture all matches in a single subject string

The `nc::capture_all_str` function is for the common case of
extracting each match from a multi-line text file (a single large
subject string). In this section we demonstrate how to extract data
Expand Down
2 changes: 0 additions & 2 deletions vignettes/v3-capture-melt.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ vignette: >
\usepackage[utf8]{inputenc}
---

# Capture melt

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down
2 changes: 0 additions & 2 deletions vignettes/v4-comparisons.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ vignette: >
\usepackage[utf8]{inputenc}
---

# Comparisons with other packages

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down
2 changes: 0 additions & 2 deletions vignettes/v5-helpers.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ vignette: >
\usepackage[utf8]{inputenc}
---

# Helper functions

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down
2 changes: 0 additions & 2 deletions vignettes/v6-engines.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ vignette: >
\usepackage[utf8]{inputenc}
---

# Uniform interface to three regex engines

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down
2 changes: 0 additions & 2 deletions vignettes/v7-capture-glob.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ vignette: >
\usepackage[utf8]{inputenc}
---

# Reading regularly named files

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
Expand Down

0 comments on commit 487f89b

Please sign in to comment.