简体   繁体   中英

Error in library(reshape2) : there is no package called ‘reshape2’

Although I installed the 'reshape2' packages, it does not run when I type library(reshape2) . Also, I can not see the package in the package list. I can see it in the directory where packages are stored. (For example: C:/Program Files/R/R-3.5.1/library ) But it is not shown in the RStudio as packages, and I cannot use it. How can I install it correctly?

My .libPaths() is:

"C:/Users/batuh/Documents/R/win-library/3.5"
"C:/Program Files/R/R-3.5.1/library"

When I type install.packages("reshape2") , it says:

package ‘reshape2’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot remove prior installation of package ‘reshape2’

Here how I solved the problem:

I terminated all R sessions from task manager. There were at least 8 of them running simultaneously even though I closed Rstudio.

Then I deleted the reshape2 folder from my library directory, which you can reach by .libPaths() function.

There will be 2 directories, the first one is where the package should be stored. For example:

C:/Users/batuh/Documents/R/win-library/3.5

Then I restarted Rstudio and installed it without problems.

如果您是第一次在 RStudio 中使用 install.packages("reshape2") 它将起作用

我只是下载了“reshape2”的包并解决了这个问题。

install.packages("reshape2")

Here is what worked for me. First I ran, in the R studio console, remove.packages("reshape2") . When it was done removing reshape2, I reinstalled it by running install.packages("reshape2") in R studio console. I then restarted R and the code running reshape2 worked fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM