View source: R/match_consecutive_delimiters.R
match_consecutive_delimiters | R Documentation |
This is just a convenience function that takes a vector of deliminaters and returns a list of delimiter pairs.
match_consecutive_delimiters( x, errorOnInvalidX = FALSE, errorOnOdd = FALSE, onOddIgnoreFirst = FALSE )
x |
The vector with delimiter indices |
errorOnInvalidX |
Whether to return |
errorOnOdd |
Whether to throw an error if the number of delimiter indices is odd. |
onOddIgnoreFirst |
If the number of delimiter indices is odd and no
error is thrown, whether to ignore the first ( |
A list where each element is a two-element vector with the two consecutive delimiters
rock::match_consecutive_delimiters( c(1, 3, 5, 10, 19, 25, 30, 70) ); exampleText <- c( "some text", "delimiter", "more text", "delimiter", "filler text", "intentionally left blank", "delimiter", "final text", "delimiter" ); rock::match_consecutive_delimiters( grep( "delimiter", exampleText ) );
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.