简体   繁体   English

安装ggp​​lot2时出现错误消息

[英]Error message when installing ggplot2

I have been trying to install ggplot2 but get the following error: 我一直在尝试安装ggplot2但出现以下错误:

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace 'scales' 0.4.0 is being loaded, but >= 0.4.1 is required loadNamespace(i,c(lib.loc,.libPaths()),versionCheck = vI [[i]])中的错误:正在加载名称空间“ scales” 0.4.0,但需要> = 0.4.1
ERROR: lazy loading failed for package 'ggplot2' 错误:软件包“ ggplot2”的延迟加载失败
* removing '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ggplot2' *删除'/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ggplot2'

Just so you know, I am using RStudio 1.0.136 and R 3.2.1 GUI Snow Leopard. 大家知道,我正在使用RStudio 1.0.136和R 3.2.1 GUI Snow Leopard。 Could it be a problem of compatibility with the old version of R that I am using? 可能是与我使用的旧版本R兼容的问题吗? Does anyone know what the above means? 有人知道上面的意思吗?

install.packages("scales")
install.packages("ggplot2")

will do the trick. 会成功的 Also try to keep your packages in R updated in the future, since R packages usually depend on the latest versions of other packages. 还要尝试将来使R中的软件包保持更新,因为R软件包通常依赖于其他软件包的最新版本。

如果您在Windows上,请尝试: install.packages("ggplot2", type="win.binary",dependencies = TRUE)否则请根据您的操作系统,检查类型和二进制包部分中的文档以获取正确的类型: https:// www.rdocumentation.org/packages/utils/versions/3.5.2/topics/install.packages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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