install multiple different versions of R in ubuntu 18.04

@SESR, I noticed you posted a similar question on the closed topic here:
Change R version to a previous one! (ubuntu 18)

I wrote a bash script just for this purpose. It can be found on github as a gist here: