Hey I might need some help with a loop I tried to create cause its not giving me the output I want

I tried to creat a loop to calculate some statistics for a ACC df. The loop in general works but the output it creates is not right. It just creats a table where every row hast the same vales for each column and cause I´m new to R I dont know where I made a mistake. I hope someone can help me. Thanks already in advance!!

´´´´
SP <- ACC data

It is rather difficult to read an image of code. In the future, please post the actual code with lines consisting of three back ticks before and after the code, like this:
```
Your code here
```
I see that you define Interval at the top of the loop as a subset of SP and then you attach() it, but I do not see where you use Interval after that. All of the calculations are done using SP. Should all the references to SP from line 39 on be changed to Interval?