Suppose I have the following dataframe (here in simplified version):
| id | date | cond | ret | | -- | ---- | ---- | --- | | a | t1 | 1 | n1 | | a | t2