Not able to install packages

Error Information:

Not able to install packages in RStudio

Description of issue -
I am trying to install packages on RStudio with the following command
install.packages("caret")
and getting the below error
Error in install.packages : STRING_ELT() can only be applied to a 'character vector', not a 'NULL'
Steps taken so far -
Earlier i have checked the paths through .libPaths(), it was showing me 2 paths.
I have changed the RProfile to get in the sync with single path and now when i am running RStudio as administrator its showing me one path.
"C:/Program Files/R/R-3.4.1/library"
But still i am not able to install packages on RStudio

System Information:

  • RStudio Edition: (Desktop or Server) Desktop
  • RStudio Version: RStudio 2022.02.0 Build 443
  • OS Version: Windows 10
  • R Version: 3.4.1

Also:

  • RStudio diagnostics report:
  • Your sessionInfo():
  • RStudio crash report:
  • RStudio application log files:

From Troubleshooting Guide: Using RStudio

Not a direct answer to your question, but why not use a more recent version of R? The current version for Windows is 4.1.2

The earlier code is written in 3.4.1 version and we have to continue from there.

Can you please post the complete console output you get when you try to install?

Also, be aware that this problem is unlikely to be related to the RStudio IDE, package installation is handled by the R interpreter, not by the IDE.

Please find above screenshot for the error.

That is weird, it seems your R installation is in a bad state or it has get corrupted some how, try restarting your session, if the problem persists try reinstalling R (remove the old package library before reinstalling).

1 Like

I am getting precisely the same behavior, from a fresh, clean installation of RStudio (v2022.02.0 Build 443).

I tried a full uninstall and re-install, but still the same. So I'll be watching this space for the next few days...

image

I meant a fresh R installation, not RStudio installation, RStudio is an IDE for the R programming language but it has no effect on your R package library.

Thanks!

I had 2 separate (and older) installations of "R", 3.3.3 and 3.3.3.0 (there's a difference?)

I uninstalled them both, and installed v4.1.2. That seemed to fix everything.

Thanks for the help.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.