R version 4.1.0 安装ggplot2,options(pkgType=“binary“) install.packages(“ggplot2“)

R version 4.1.0 安装ggplot2

    • [R version 4.1.0 安装ggplot2](#R version 4.1.0 安装ggplot2)
    • [1. 报错信息](#1. 报错信息)
    • [2. 成功安装](#2. 成功安装)
    • [3. 参考资料](#3. 参考资料)

R version 4.1.0 安装ggplot2

python 复制代码
# 直接安装报错
install.packages("ggplot2")

# 安装成功
options(pkgType="binary")
install.packages("ggplot2")

1. 报错信息

python 复制代码
> install.packages("ggplot2")

将程序包安装入'C:/Users/chen_/Documents/R/win-library/4.1'
(因为'lib'没有被指定)
还安装相依关系'scales'


  有二进制版本的,但源代码版本是后来的:
        binary source needs_compilation
scales   1.2.1  1.3.0              TRUE
ggplot2  3.4.2  3.5.0             FALSE

  Binaries will be installed
试开URL'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.1/scales_1.2.1.zip'
Content length 617139 bytes (602 KB)
downloaded 602 KB

package 'scales' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\chen_\AppData\Local\Temp\Rtmp0IK5HV\downloaded_packages
安装源码包'ggplot2'

试开URL'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/ggplot2_3.5.0.tar.gz'
 length 3564967 bytes (3.4 MB)
downloaded 3.4 MB

* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  载入了名字空间'scales' 1.2.1,但需要的是>= 1.3.0
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
停止执行
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/chen_/Documents/R/win-library/4.1/ggplot2'

The downloaded source packages are in
        'C:\Users\chen_\AppData\Local\Temp\Rtmp0IK5HV\downloaded_packages'
Warning message:
In install.packages("ggplot2") :
  installation of package 'ggplot2' had non-zero exit status

2. 成功安装

python 复制代码
> options(pkgType="binary")
> install.packages("ggplot2")
> 
将程序包安装入'C:/Users/chen_/Documents/R/win-library/4.1'
(因为'lib'没有被指定)

  有二进制版本(将被安装),但源代码版本是后来的:
        binary source
ggplot2  3.4.2  3.5.0

试开URL'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.1/ggplot2_3.4.2.zip'
 length 4295743 bytes (4.1 MB)
downloaded 4.1 MB

package 'ggplot2' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\chen_\AppData\Local\Temp\Rtmp0IK5HV\downloaded_packages

> system.file(packages="ggplot2")
[1] ""

3. 参考资料

R语言安装包报错non-zero exit status问题

载入了名字空间'htmltools' 0.5.6,但需要的是>= 0.5.7解决方案

R语言-安装ggplot2,这个我尝试了,但是没起到作用。仍然感谢大佬。

相关推荐
善木科研1 天前
读文献先读图:GO弦图怎么看?
机器学习·数据分析·r语言
Tiger Z1 天前
R 语言科研绘图第 55 期 --- 网络图-聚类
开发语言·r语言·贴图
十三画者1 天前
【数据分析】R版IntelliGenes用于生物标志物发现的可解释机器学习
python·机器学习·数据挖掘·数据分析·r语言·数据可视化
lishaoan774 天前
实验设计与分析(第6版,Montgomery著,傅珏生译) 第10章拟合回归模型10.9节思考题10.12 R语言解题
回归·r语言·线性回归·残差分析·实验设计与数据分析·回归显著性
南瓜胖胖4 天前
【R语言编程绘图-mlbench】
开发语言·机器学习·r语言
天桥下的卖艺者4 天前
R语言使用随机过采样(Random Oversampling)平衡数据集
开发语言·r语言
Biomamba生信基地5 天前
R语言基础| 创建数据集
开发语言·r语言·生信·医药
lishaoan775 天前
实验设计与分析(第6版,Montgomery)第5章析因设计引导5.7节思考题5.19 R语言解题
r语言·方差分析·实验设计与分析·残差分析·正态假设·交互作用
weixin_493202636 天前
R语言错误处理方法大全
开发语言·r语言
lishaoan776 天前
实验设计与分析(第6版,Montgomery)第4章随机化区组,拉丁方, 及有关设计4.5节思考题4.1~4.4 R语言解题
r语言·统计分析·方差分析·实验设计与分析·随机化区组