I made sure that the restricted and universe repositories are enabled (which was disabled in case of mine ). For doing this , Hit Alt + F2 type software-properties-gtk and hit Enter.
Under Ubuntu Software
tab enable all the repositories.
After which run
sudo apt-get update
Again run
sudo apt-get install r-base-dev
And done successfully.
I got the above solution from this link