[R] Replace a dot in a string (".") with a space (" ")

John miaojpm at gmail.com
Sat Nov 19 01:13:27 CET 2016


   Is there any function that replaces a dot with a space? I expect "c t"
from the output of the second call of function sub, but it did not do so.

> sub("a", "b", "cat")
[1] "cbt"
> sub(".", " ", "c.t")
[1] " .t"


	[[alternative HTML version deleted]]

More information about the R-help mailing list