Lets say I have start=1, end=12 and the interval start:end.
I want to split it in bins of x=2 so that i will get a data frame of
start.index end.index
1 1 2
2 3 4
3 5 6
4 7 8
5 9 10
6 11 12
In this case it results to 6 bins. start, end, and x are always integers
Is there any function to do this? Obvisouly when start%%x!=0 the one bin might be larger or smaller than the others but I dont mind.
Any help?
Here is a simple example of such a function:
And with an odd number of observations so we get different bin widths for the last one: