Description Usage Arguments Value
A wrapper that vectorizes function longest_substring
, allowing an input vector and
either a vector or matrix output.
1 2 | longest_substring_vec(a, b = NULL, default = NA_character_,
matrix_out = is.null(b), USE.NAMES = matrix_out)
|
a |
a character vector |
b |
a character vector, or |
default |
value to return when no matching substring is found. By default |
matrix_out |
logical. If |
USE.NAMES |
logical. If |
Depending on matrix_out
either a vector or a matrix of longest common substrings.
If matrix_out = TRUE
, returns a matrix of longest common substring for each of the elements
of a
and b
, with rows and columns corresponding to a
and b
respectively.
If matrix_out = FALSE
, returns a vector of common substrings for the corresponding elements
in vector a
and b
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.