Question: I have the dataset looks as following, the time is record in timezone GMT:

```
{"id":1,"Timestamp:"Mon, 11 May 2015 07:57:46 GMT"}
{"id":2,"Timestamp:"Mon, 11 May 2015 08:57:46 GMT"}

```

I would like to count how many rows for a certain time period:

```
from ISODate("2015-05-10T01:40:08.963Z")
to ISODate("2015-05-12T01:40:08.963Z")

```

Is it possible to do this?

Answer: 
You can use `relist`:

```
relist(seq_along(unlist(rec_list)), skeleton = rec_list)
# [[1]]
# [[1]][[1]]
# [1] 1 2 3 4 5
# 
# [[1]][[2]]
# [1] 6
# 
# 
# [[2]]
# [[2]][[1]]
# [1]  7  8  9 10
# 
# [[2]][[2]]
# [1] 11 12 13 14 15 16

```
If you wanted to uniquely index each element of a nested list, you could start with the `rapply()` function which is the recursive form of the `apply()` family. Here I use a special function that can uniquely index across a list of any structure

```
rapply(rec_list, 
local({i<-0; function(x) {i<<-i+length(x); i+seq_along(x)-length(x)}}),     
how="replace")

```

other functions are simplier, for example if you just wanted to seq\_along each subvector

```
rapply(rec_list, seq_along, how="replace")

```