On a previous post I explained how to install R on Ubuntu 16.04 without further complications.
Now here are the equivalent steps on Ubuntu 17.10. The presented script also installs Java and common packages as I wrote this for a fresh install.
Administrator (sudo) access to be able to install packages.
This script will install everything.