Install devtools. Most of the time the problem in installing R packages is that these tools are not there. Once this is installed, the zero exit error goes away.
install.packages('devtools')
https://www.digitalocean.com/community/tutorials/how-to-install-r-packages-using-devtools-on-ubuntu-16-04