I have a dataframe like below:
Col1 Col2
A 5!5!!6!!3!!m
B 7_8!!6!!7!!t
structure(list(Col1 = c("A", "B"), Col2 = c("5!5!!6!!3!!m", "7_8!!6!!7!!t" )), class = "data.frame", row.names = c(NA, -2L))
How do I create a new column that extracts the 3rd parse of the strings found in Col2?
In SQL I am using SPLIT_PART function:
SPLIT_PART(Col2, '!!', 3)
I am looking to find an equivalent function in R.
Expected output:
Col1 Col2 Col3
A 5!5!!6!!3!!m 3
B 7_8!!6!!7!!t 7