Thanks for your suggestions.
Cheers,
Chris
--
View this message in context:
http://r.789695.n4.nabble.com/Replace-split-with-regex-for-speed-tp3386098p3388958.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
Try this:
sub(\\.(\\d+)$, \\1, ts)
On Thu, Mar 17, 2011 at 11:01 PM, rivercode aqua...@gmail.com wrote:
Have timestamp in format HH:MM:SS.MMM.UUU and need to remove the last . so
it is in format HH:MM:SS.MMMUUU.
What is the fastest way to do this, since it has to be repeated on millions
=))
user system elapsed
0.880.000.89
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Henrique Dallazuanna
Sent: Friday, March 18, 2011 8:32 AM
To: rivercode
Cc: r-help@r-project.org
Subject: Re: [R] Replace split
Have timestamp in format HH:MM:SS.MMM.UUU and need to remove the last . so
it is in format HH:MM:SS.MMMUUU.
What is the fastest way to do this, since it has to be repeated on millions
of rows. Should I use regex ?
Currently doing it with a string split, which is slow:
head(ts)
[1]
4 matches
Mail list logo