Learn R Programming

PTXQC (version 0.82.6)

LCSn: Find longest common substring from 'n' strings.

Description

Warning: heuristic! This is not guaranteed to find the best solution, since its done pairwise with the shortest input string as reference.

Usage

LCSn(strings, min_LCS_length = 0)

Arguments

strings

A vector of strings in which to search for LCS

min_LCS_length

Minimum length expected. Empty string is returned if the result is shorter

Value

longest common substring (or "" if shorter than min_LCS_length)

Examples

Run this code
# NOT RUN {
LCSn(c("1_abcde...", "2_abcd...", "x_abc..."))  ## result: "_abc"

# }

Run the code above in your browser using DataLab