Here’s a CRAN package for that:
library(qualV)
sapply(seq_along(a), function(i)
paste(LCS(strsplit(a[i], '')[[1]], strsplit(b[i], '')[[1]])$LCS,
collapse = ""))
More Related Contents:
- longest common substring in R finding non-contiguous matches between the two strings
- How to join (merge) data frames (inner, outer, left, right)
- Issue when passing variable with dollar sign notation ($) to aes() in combination with facet_grid() or facet_wrap()
- Using Reshape from wide to long in R [closed]
- R: rJava package install failing
- Pass arguments to dplyr functions
- How to use facets with a dual y-axis ggplot
- What is the width argument in position_dodge?
- dplyr::select function clashes with MASS::select
- identify groups of linked episodes which chain together
- Coalesce two string columns with alternating missing values to one
- Create a co-occurrence matrix from dummy-coded observations
- Data.table meta-programming
- add “floating” axis labels in facet_wrap plot
- Insert picture/table in R Markdown [closed]
- Format number as fixed width, with leading zeros [duplicate]
- How to reset row names?
- Problems when trying to load a package in R due to rJava
- ggplot2 3D Bar Plot
- inst and extdata folders in R Packaging
- Remove duplicate column pairs, sort rows based on 2 columns [duplicate]
- Format date as Year/Quarter
- Converting a character string into a date in R
- Determine the data types of a data frame’s columns
- Handling dates when we switch to daylight savings time and back
- R: t-test over all columns
- Selecting a subset of columns in a data.table
- How to remove leading “0.” in a numeric R variable
- Is there a way to output text to the R console in color
- Using a static (prebuilt) PDF vignette in R package