https://researchdatapod.com/how-to-solve-r-error-attempt-to-apply-non-function/
How to Solve R Error: attempt to apply non-function