Skip to content
Back to formatted view

Raw Message

Message-ID: <a34b4f40-9766-8031-b4ad-15f5307a593e@gmail.com>
Date: 2018-05-25T16:09:22Z
From: Evan Cooch
Subject: options other than regex
In-Reply-To: <7837.1527263662@minshall-apollo.minshall.org>

Numbers -- thanks. Another clever trick.

On 5/25/2018 11:54 AM, Greg Minshall wrote:
> 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.
> .
>


	[[alternative HTML version deleted]]