how do i parse this string in R so that it will look like the following? I'm trying to do this through regular expression through gsub(), but not getting any luck
Input:
"dag{D<-{G}; A<-{D}; A<-{G}; A<-{Q}}"
Output:
"D<-G;A<-D;A<-G;A<-Q"
I've tried:
gsub("dag{(.*)}","","dag{D<-{G}; A<-{D}; A<-{G}; A<-{Q}}")
Is this good for you ?
gsub(pattern = "dag|\\{|\\}|[[:space:]]", replacement = "", x = "dag{D<-{G}; A<-{D}; A<-{G}; A<-{Q}}")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With