I can't update my R version in Linux

Please can someone help me update R Studio. I type the following command in the terminal: sudo apt-get update and sudo apt-get install r-base it says I have the newest version but it's not the newest version
here is the message "0 upgraded, 0 newly installed, 0 to remove and 319 not upgraded."
r-base is already the newest version (3.5.2-1).

Just to clarify, RStudio is an IDE for the R programming language but they are both separate pieces of software. From your description it seems you want to update R, to help you with that, can you tell us what Linux distribution are you using?

Thank you for your reply. I think my Linux distribution is Debian.

Then you can follow the official installation instructions for Debian

https://cran.r-project.org/bin/linux/debian/

Thanks! I'll do that.
Another problem that I have been having since that day is the following message when I try to open my old version Rstudio.

Cannot Connect to R
RStudio can't establish a connection to R. This usually indicates one of the following:

The R session is taking an unusually long time to start, perhaps because of slow operations in startup scripts or slow network drive access.
RStudio is unable to communicate with R over a local network port, possibly because of firewall restrictions or anti-virus software.
Please try the following:

If you've customized R session creation by creating an R profile (e.g. located at ~/.Rprofile), consider temporarily removing it.
If you are using a firewall or antivirus software which guards access to local network ports, add an exclusion for the RStudio and rsession executables.
Run RGui, R.app, or R in a terminal to ensure that R itself starts up correctly.
Further troubleshooting help can be found on our website:

Troubleshooting RStudio Startup

Thanks