Allow me to introduce you to the Berkeley R-Utilities:

https://en.wikipedia.org/wiki/Berkeley_r-commands

They do the job, quite well.

I suggest that you use them for all your production needs, exclusively!