In general we recommend you don't use apt install to update R, but to install multiple versions of R side-by-side, using the instructions at RStudio Install R - RStudio Documentation
The reason for this recommendation is that once you update R, some of your older scripts could potentially break. So it's generally better to let your users choose which version of R to use.
That said, you can also follow the instruction from CRAN directly, if you prefer: Ubuntu Packages For R - Brief Instructions, specifically this part:
# update indices
apt update -qq
# install two helper packages we need
apt install --no-install-recommends software-properties-common dirmngr
# import the signing key (by Michael Rutter) for these repo
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"