I want to split V2 column to two columns by ')*('
V1 V2
r1 (Direct)*(Mary*(Sewnf 45*S-a))
r2 (Ax 70a12*Qunion)*(Kin - 32431*Tip)
r3 (PAN*Q-23)*(BE 05/514/10)
then I can see below.
V1 V2 V3
r1 (Direct Mary*(Sewnf 45*S-a))
r2 (Ax 70a12*Qunion Kin - 32431*Tip)
r3 (PAN*Q-23 BE 05/514/10)
Here is something I have tried, but apparently it does not get my goal.
library(stringr)
str_split_fixed(as.character(data$V2), '\\)*(', 2)
str_split_fixed(as.character(data$V2), '\\)*\\(', 2)
and also trying.
strsplit(as.character(data$V2), '\\)*(')
How can I revise my script?