Error installing ggplot2

佐手、 提交于 2019-12-04 12:41:52

I had the same error running ggplot this evening, essentially you need to try to install all the dependencies that failed. For me it was "scales", then "munsell" and then finally (the actual problem) "colorspace" which hadn't be updated since I upgraded to 3.1.1. In your case, it looks like you want to first try installing "foreign" and then try ggplot2 again. Keep loading dependencies that error manually until you find the real problem.

You can specify that the install.packages() call also install all dependent packages:

if(!require(ggplot2)) install.packages('dplyr',dependencies = TRUE)

the above code first checks to see if ggplot2 package is loaded, if not it tries to load the apckage. If it cannot load the package, it then tries to install the package and all of package its dependencies.

With RTools installed, I got this to work:

install.packages("ggplot2", type="source",dependencies = TRUE)

Compiled a few packages...

Make sure your PATH is updated to point to RTools properly, i.e. includes

c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin

at the front.

I am using Rtools32.exe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!