Computing sequential time variable- Long format

Hi Everyone,

I am currently looking at lung function decline/change over time. Lung function parameters such as fev1, fvc, fev1/fvc have been converted to z-scores .

The data is in long format with each individual having more than 2 assessments until 4. Thus, each individual has data in 2 to 4 rows depending on the no of assessments he/she has had. I have a date variable for each assessment

I am interested in plotting a mixed effects model on the basis of that. I am unable to create a sequential time variable such as 1,2,3,4 depending on assessments to include in the model. If anyone could please help me with that it would be great.