R/only_captures.R

Defines functions only_captures

Documented in only_captures

### Extract capture group columns from match.mat and assign optional
### groups to "".
only_captures <- function(match.mat, stop.fun){
  group.mat <- match.mat[, -1, drop=FALSE]
  missing.match <- is.na(match.mat[,1])
  stop.fun(missing.match)
  group.mat[is.na(group.mat) & !missing.match] <- "" #optional groups
  group.mat
}

Try the nc package in your browser

Any scripts or data that you put into this service are public.

nc documentation built on March 25, 2020, 5:10 p.m.