Good evening,
could someone please help me with the following error message? I uninstalled my older version and installed the R.4.5.0-win and also RStudio-2025.05.1-513 today. I am not able to install the package tidyverse and I am kind of stuck, after reading the previous threads on this topic this is what I tried:
And I know this sounds really lame, but sometimes a whole fresh restart of RStudio and R helps (restarting R in the Session menu, and/or Quit Session in the Session menu and reopen RStudio) with installing packages...
This means that the scales package, and thus the tidyverse in general needs at least R version 4.1.0. You probably have an older version and you'll need to update your R version.
If you really don't want to do that, then you can use an older CRAN snapshot from Posit Package Manager, one that still supports your R version.
The OP (@Aneta.R) indicated that the new installation was R.4.5.0 which is why that error message is confusing, and which is why a fresh re-start might help.
It seems that the current session they are working in is not recognizing the correct R version?
Typing version in the console should tell you the version of R the session is using.
You can also go to the tab "Terminal" (not "Console"!) and type in R --version to get the same information. If, for some reason (after re-starting everything), this is not R.4.5.0, you can run which r in the Terminal to see where RStudio is getting its R version from on your computer (in case you installed the new version manually in a different place than the usual place it goes).
As an FYI to the OP, not sure how you updated R, but a pretty safe way to update R is to run:
The advantage is that this also updates your packages.
But for RStudio you would still have to download it from the website.
And generally I am weary of uninstalling older R versions as this might break certain "connections" (I am a data scientist, not a computer engineer or computer scientist...). If I feel I do really need to get rid of an old version, I would use uninstall.R(), also from the installr package, and I would definitely not uninstall manually.
Hello @GeraldineK , yes sadly this gives me the following errors:
ERROR: dependency 'rmarkdown' is not available for package 'reprex'
removing 'C:/Users/Aneta Ritz-Radlinska/Documents/R/win-library/4.0/reprex'
Warning in install.packages :
installation of package ‘reprex’ had non-zero exit status
ERROR: dependencies 'dbplyr', 'dtplyr', 'googledrive', 'googlesheets4', 'modelr', 'reprex', 'rvest' are not available for package 'tidyverse'
removing 'C:/Users/Aneta Ritz-Radlinska/Documents/R/win-library/4.0/tidyverse'
Warning in install.packages :
installation of package ‘tidyverse’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Aneta Ritz-Radlinska\AppData\Local\Temp\RtmpAh9ALl\downloaded_packages’
Have a look at my other response (to @Gabor): the fact that the error message shows C:/Users/Aneta Ritz-Radlinska/Documents/R/win-library/4.0/ is a sign that there is something wrong with the version of R that is being used. That's what those last 2 numbers indicate: they should be 4.5 in your case.
So have a look at my other response to check the R version, and if re-starting everything fresh does not help, we would need a bit more information on how exactly you re-installed R, RStudio, and uninstalled the old R version.
Hello Gabor and @GeraldineK , thank you for your messages! After starting a fresh session and also typing version in the console , I see this notification that my version is 4.0.3 :
version.string R version 4.0.3 (2020-10-10)
nickname Bunny-Wunnies Freak Out
However, I installed RStudio-2025.05.1-513 yesterday and also when I check for Updates in theHelp section, it says that I am using the latest version.
Before installing R and RStudio-2025.05.1-513 yesterday from https://posit.co/download/rstudio-desktop/ I tried manually uninstalling the old version (just by selecting 'uninstall' with the right mouse click). So probably that caused the issues. When I try running which r in the Terminal to see where RStudio is getting its R version from on my computer, it would not find this command.
Today I tried updating it with
install.packages("installr")
library(installr)
updateR()
and Rstudio from the website again but still I see that my version is 4.0.3 (2020-10-10). Would you know what to try next?
Maybe so, but that's not the version they are running, it seems. At least that's the only logical explanation to me.
You can type
getRversion()
in R to double check the R version you are running.
My advice would be not to use the installr package, as it copies packages between libraries and packages built for an old R version often do not work in a newer R version. You'll end up with packages that do not load in the new R version. There are many posts on this web site about broken packages and one common source is using the installr package.
Also, if you already installed R 4.5.0, there is no need to reinstall it. But you need to make sure that you are running R 4.5.0. You might want to uninstall the older R versions you have, though. (Or use a tool like rig [1] to manage multiple R versions.)
There is certainly no need to reinstall RStudio, but you need to make sure that RStudio is using the newly installed R 4.5.0.
Thanks so much @Gabor , it seems the issue is fixed now! I just changed the R version in * Tools > Global Options>General>R version and changed the path, now R studio is opening the new version. Thanks again for your help
Glad it all worked out in the end!
Generally, if you install a new version of R and then a new version of RStudio (in that order), when you open RStudio, it should automatically find the latest version of R on your computer. But yeah, sometimes funky things happen...