In the column "a", I have the full words and in the word "b", I have a substring of the word. How I can find the remaining substring. The ideal result should look like "column_to_extract" column.
a <- c("clean", "player", "rubbish", "lock")
b<- c("ean", "er", "bbish", "ck")
df1 <- data.frame(a,b)
The result should be:
a b column_to_extract
1 clean ean cl
2 player er play
3 rubbish bbish ru
4 lock ck lo