df <- data.frame(
rbind(
c(1, 1, 2, 2, 2, 3, 3, 3, 3),
c(1, 2, 3, 4, 4, 4, 4, 2, 6)
)
)
# Example 1: Without tolerance
longstring(df)
# Example 2: With tolerance
longstring(df, tolerance = 1)
Run the code above in your browser using DataLab