https://researchdatapod.com/how-to-solve-r-error-subscript-out-of-bounds/
How to Solve R Error: Subscript out of bounds