How to install R packages in VS code

Viewed 1011

I have installed R in vscode and all its extensions. I tried installing packages through vscode terminal.But after successfull installation when run the code it says no package called "reshape2"(i used library("reshape2")) to import the library.

3 Answers

Just try to install in command prompt and then try to install in vs code editor.

Try the following command in your terminal,

install.packages(x) library(x)

NB: Replace x with your library name

Try the following command in your terminal,

"C:\Program Files\R\R-4.1.0\bin\x64\R.exe" --vanilla -e  "install.packages('reshape2', repos='http://cran.us.r-project.org')"

Note: With the path of your R executable

Related