invert_match | R Documentation |
Invert a matrix of match locations to match the opposite of what was previously matched.
invert_match(loc)
loc |
|
Returns a numeric matrix
giving locations of non-matches.
numbers <- "1 and 2 and 4 and 456" and_loc <- str_locate_all(numbers, "and")[[1]] str_sub(numbers, and_loc[, "start"], and_loc[, "end"]) num_loc <- invert_match(and_loc) str_sub(numbers, num_loc[, "start"], num_loc[, "end"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.