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 mailin
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 with regex for speed ?
Try this:
sub("\\.(\\d+)$", "\\1", ts)
On Thu, Mar 17, 2011 at 11:01 PM, rivercode wrote:
>
> Have timest
Try this:
sub("\\.(\\d+)$", "\\1", ts)
On Thu, Mar 17, 2011 at 11:01 PM, rivercode 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
> of row
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] 09:30:00
4 matches
Mail list logo