remove plyr depend

Hi.

Thanks for this very useful function.
I made some changes in the code and I want to share it. Can you find it useful.
Old and new version provides identical results and execution time.

Regards,
Artem Klevtsov