All, I have a variable called `go` and it has a single quote in the name column of line 47 that I am trying to get rid of. I have tried using gsub, but I cannot get the syntax correct to tell R to remove the ' (single quote).
> go[47,] gvkey Symbol Name Rank MarketCap MemoDate Action Analyst Reason SharesHeld 75 065105 BJ BJ'S WHOLESALE CLUB INC 0.9579 2258.24 <NA> <NA> <NA> <NA> <NA> > I have tried every combination I could think of, some of them being: gsub(go, `'`, ` `) gsub(go, "'", " ") gsub(go, "\'S", " S") gsub(go, "'S", "S") I understand the problem is that R interprets the single quote as a single quote instead of a character that I want to remove, but I don't know how to tell R that I want to identiy the single quote and remove it. This is probably easy for some, but to me it seems much more difficult than it should be. Thanks, Roger ********************************************************************** * This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No right to confidential or privileged treatment of this message is waived or lost by any error in transmission. If you have received this message in error, please immediately notify the sender by e-mail, delete the message and all copies from your system and destroy any hard copies. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.