interval2state function

Adds a state column to a dataset from interval data