[R] How to replace '$' sign?

Rui Barradas ruipbarradas at sapo.pt
Thu Mar 28 16:49:17 CET 2013


Hello,

Try

gsub("[$,]", "", "$232,685.35436")

Hope this helps,

Rui Barradas

Em 28-03-2013 15:39, Christofer Bogaso escreveu:
> Hello again,
>
> I want to remove "$" sign and replace with nothing in my text.
> Therefore I used following code:
>
>> gsub("$|,", "", "$232,685.35436")
> [1] "$232685.35436"
>
>
> However I could not remove '$' sign.
>
> Can somebody help me why is it so?
>
> Thanks and regards
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list