researchdatapod.com
How to Solve R Error in unique.default(x, nmax = nmax): unique() applies only to vectors
This error occurs when we try to use the ave() function without specifying the FUN argument. We can solve this error by specifying the FUN argument explicitly. For example, average