I'm trying to replace en- and em-dashes by simple dash
dashes <- c("13.9","14.5","—1.7","—3.0","-5.0")
gsub("[-–—]","-", dashes)
but doesn't work unfortunately. I still see "—1.7" and "—3.0" instead of "-1.7" and "-3.0".
Is there anything I'm missing in gsub to achieve desired output?
Comments
Post a Comment