The version of R that ships with Ubuntu 18.04 LTS (Bionic), 3.4.4, is perfectly fine for many projects.
But to get the latest R binaries and packages from CRAN (Comprehensive R Archive Network) without having to mess around with static binaries and source, you'll need to add their apt repo:
https://cloud.r-project.org/bin/linux/ubuntu/README.html
This repo does not include all the packages you might need, so CRAN recommends adding this PPA from Michael Rutter: