[R] options other than regex

Greg Minshall m|n@h@|| @end|ng |rom @cm@org
Fri May 25 17:54:22 CEST 2018


Evan,

are you really looking at numbers, or just at character strings (that,
in your case, happen to be numbers)?  if just characters, this rather
odd combination of strsplit() and Reduce() might do the trick:
----
> x <- '10110111'
> print(x)
[1] "10110111"
> y <- Reduce(function (x,y) { paste(x, y, sep=".") }, unlist(strsplit(x, "")), init="", right=TRUE)
> print(y)
[1] "1.0.1.1.0.1.1.1."
----

cheers.




More information about the R-help mailing list