R last observation for milliseconds
<p>I have <code>xts</code> objects for daily trades and quotes for five years with a time stamp of the index containing milliseconds. I need to group rows which have same seconds time stamp and the same milliseconds. I can use a loop, but in this case it works enormously long. I'm trying to use endpoints function, but it doesn't work. Here is an example: </p>

<pre><code>testData &lt;- as.xts( 1:4, order.by = c(as.POSIXct("2009-09-30 10:00:00.543", "%Y-%m-%d %H:%M:%OS", tz="UTC"), as.POSIXct("2009-09-30 10:00:00.545", "%Y-%m-%d %H:%M:%OS", tz="UTC"),as.POSIXct("2009-09-30 10:00:01.543", "%Y-%m-%d %H:%M:%OS", tz="UTC"),as.POSIXct("2009-09-30 10:00:01.543", "%Y-%m-%d %H:%M:%OS", tz="UTC")))

                       [,1]
2009-09-30 23:00:00.542    1
2009-09-30 23:00:00.545    2
2009-09-30 23:00:01.542    3
2009-09-30 23:00:01.542    4

endpoints(testData, on = "us")

[1] 0 4
</code></pre>

<p>But I expect it to return </p>

<pre><code>[1] 0 1 2 4
</code></pre>

<p>So time with different milliseconds are considered different. 
How can I do thit, please help me! </p>