[R] Replacing dot with empty space

Gabor Grothendieck ggrothendieck at gmail.com
Tue Feb 10 12:42:54 CET 2009


Also, try these alternatives:

sub(".", " ", x, fixed = TRUE)
chartr(".", " ", x)


On Tue, Feb 10, 2009 at 4:02 AM, Sergey Goriatchev <sergeyg at gmail.com> wrote:
> OK, got it now:
> sub("[.]", " ", "ED4.Comdty")
>
>
> On Tue, Feb 10, 2009 at 10:01, Sergey Goriatchev <sergeyg at gmail.com> wrote:
>> Hello, everyone
>>
>> How do I replace dot with empty space in "ED4.Comdty"?
>> I need to get "ED4 Comdty"
>> tried sub() in many different ways, like sub({.}, " ", "ED4.Comdty")
>> etc but could not do it.
>>
>> Thanks in advance,
>> Sergey
>>
>
>
>
> --
> I'm not young enough to know everything. /Oscar Wilde
> Experience is one thing you can't get for nothing. /Oscar Wilde
> When you are finished changing, you're finished. /Benjamin Franklin
> Tell me and I forget, teach me and I remember, involve me and I learn.
> /Benjamin Franklin
> Luck is where preparation meets opportunity. /George Patten
>
> ______________________________________________
> 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