Let's say I have a data table (or frame) like this:

```
Time    Value
1            10
2            10
3            10
4            15
5            15
6            20

```

I'd like to attach columns that mark the time and value of the next change in Value. It would look like this:

```
Time    Value    T_Next    V_Next
1            10         4              15
2            10         4              15 
3            10         4              15 
4            15         6              20
5            15         6              20
6            20         NA          NA

```

I don't care too much about the last row. The only way I can think to do this is with some nested for loops, which would be slow and I have a large dataset. I'm sure there's a more R-style way to do it which will be more performant. Any help appreciated!