Displaying 1 result from an estimated 1 matches for "mycharvec".
2009 Aug 20
5
help with regular expressions in R
...t;
Below is my self-contained code followed by sessionInfo().
Thanks in advance for your help. I'm going to be doing a lot of text mining
in the near future. I have an excellent O'Reilly book on regex's. What is
the best reference for R's special treatment of these animals?
Mark
myCharVec <- c("[the rain in spain]", "(the rain in spain)")
gsub('\\[*.\\]', '', myCharVec)
#what I get
# [1] "[the rain in spai" "(the rain in spain)"
#what I want
[1] "" "(the rain in spain)"
> sessionInfo()
R version...