R语言安装软件包[通俗易懂]

R语言安装软件包[通俗易懂]R语言安装软件包1打开RGui.exe,执行“`install.packages(“softwarename”)“`,安装成功后会提示“`Thedownloadedbinarypackagesarein…“`,给出了程序包存放路径2选择程序包,点击“`Installpackage(s)fromlocalfiles…“`,选中路径里面下载好的程序包,会出现“`successfullyunpacked“`的提示3命令及执行结果示例1打开RGui.exe,

大家好,又见面了,我是你们的朋友全栈君。

1 打开RGui.exe,执行install.packages("software name"),安装成功后会提示The downloaded binary packages are in ...,给出了程序包存放路径

在这里插入图片描述

2 选择程序包,点击Install package(s) from local files...,选中路径里面下载好的程序包,会出现successfully unpacked的提示

> utils:::menuInstallLocal()
package ‘psych’ successfully unpacked and MD5 sums checked

在这里插入图片描述
在这里插入图片描述

3 命令及执行结果示例

R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

R是自由软件,不带任何担保。
在某些条件下你可以将其自由散布。
用'license()'或'licence()'来看散布的详细条件。

R是个合作计划,有许多人为之做出了贡献.
用'contributors()'来看合作者的详细情况
用'citation()'会告诉你如何在出版物中正确地引用R或R程序包。

用'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或
用'help.start()'通过HTML浏览器来看帮助文件。
用'q()'退出R.

> install.package("psych")
Error in install.package("psych") : 没有"install.package"这个函数
> install.packages("psych")
--- 在此連線階段时请选用CRAN的鏡子 ---
还安装相依关系‘tmvnsim’, ‘mnormt’

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/tmvnsim_1.0-2.zip'
Content type 'application/zip' length 37073 bytes (36 KB)
downloaded 36 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/mnormt_2.0.2.zip'
Content type 'application/zip' length 193615 bytes (189 KB)
downloaded 189 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/psych_2.1.9.zip'
Content type 'application/zip' length 4245236 bytes (4.0 MB)
downloaded 4.0 MB

package ‘tmvnsim’ successfully unpacked and MD5 sums checked
package ‘mnormt’ successfully unpacked and MD5 sums checked
package ‘psych’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\99\AppData\Local\Temp\RtmpEDx6Cz\downloaded_packages
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> setRepositories()
> utils:::menuInstallLocal()
package ‘psych’ successfully unpacked and MD5 sums checked
> install.packages("ggplot2")
还安装相依关系‘colorspace’, ‘cli’, ‘crayon’, ‘utf8’, ‘farver’, ‘labeling’, ‘lifecycle’, ‘munsell’, ‘R6’, ‘RColorBrewer’, ‘viridisLite’, ‘ellipsis’, ‘fansi’, ‘magrittr’, ‘pillar’, ‘pkgconfig’, ‘vctrs’, ‘digest’, ‘glue’, ‘gtable’, ‘isoband’, ‘rlang’, ‘scales’, ‘tibble’, ‘withr’


  有二进制版本的,但源代码版本是后来的:
      binary source needs_compilation
fansi  0.5.0  1.0.0              TRUE

  Binaries will be installed
试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/colorspace_2.0-2.zip'
Content type 'application/zip' length 2645168 bytes (2.5 MB)
downloaded 2.5 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/cli_3.1.0.zip'
Content type 'application/zip' length 1235892 bytes (1.2 MB)
downloaded 1.2 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/crayon_1.4.2.zip'
Content type 'application/zip' length 157657 bytes (153 KB)
downloaded 153 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/utf8_1.2.2.zip'
Content type 'application/zip' length 209987 bytes (205 KB)
downloaded 205 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/farver_2.1.0.zip'
Content type 'application/zip' length 1752511 bytes (1.7 MB)
downloaded 1.7 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/labeling_0.4.2.zip'
Content type 'application/zip' length 62679 bytes (61 KB)
downloaded 61 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/lifecycle_1.0.1.zip'
Content type 'application/zip' length 123104 bytes (120 KB)
downloaded 120 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/munsell_0.5.0.zip'
Content type 'application/zip' length 245327 bytes (239 KB)
downloaded 239 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/R6_2.5.1.zip'
Content type 'application/zip' length 84245 bytes (82 KB)
downloaded 82 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/RColorBrewer_1.1-2.zip'
Content type 'application/zip' length 55707 bytes (54 KB)
downloaded 54 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/viridisLite_0.4.0.zip'
Content type 'application/zip' length 1299512 bytes (1.2 MB)
downloaded 1.2 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/ellipsis_0.3.2.zip'
Content type 'application/zip' length 49237 bytes (48 KB)
downloaded 48 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/fansi_0.5.0.zip'
Content type 'application/zip' length 248821 bytes (242 KB)
downloaded 242 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/magrittr_2.0.1.zip'
Content type 'application/zip' length 235806 bytes (230 KB)
downloaded 230 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/pillar_1.6.4.zip'
Content type 'application/zip' length 1041521 bytes (1017 KB)
downloaded 1017 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/pkgconfig_2.0.3.zip'
Content type 'application/zip' length 22480 bytes (21 KB)
downloaded 21 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/vctrs_0.3.8.zip'
Content type 'application/zip' length 1254380 bytes (1.2 MB)
downloaded 1.2 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/digest_0.6.29.zip'
Content type 'application/zip' length 266579 bytes (260 KB)
downloaded 260 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/glue_1.6.0.zip'
Content type 'application/zip' length 173672 bytes (169 KB)
downloaded 169 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/gtable_0.3.0.zip'
Content type 'application/zip' length 434194 bytes (424 KB)
downloaded 424 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/isoband_0.2.5.zip'
Content type 'application/zip' length 2726788 bytes (2.6 MB)
downloaded 2.6 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/rlang_0.4.12.zip'
Content type 'application/zip' length 1200810 bytes (1.1 MB)
downloaded 1.1 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/scales_1.1.1.zip'
Content type 'application/zip' length 558614 bytes (545 KB)
downloaded 545 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/tibble_3.1.6.zip'
Content type 'application/zip' length 872274 bytes (851 KB)
downloaded 851 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/withr_2.4.3.zip'
Content type 'application/zip' length 217158 bytes (212 KB)
downloaded 212 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/ggplot2_3.3.5.zip'
Content type 'application/zip' length 4130171 bytes (3.9 MB)
downloaded 3.9 MB

package ‘colorspace’ successfully unpacked and MD5 sums checked
package ‘cli’ successfully unpacked and MD5 sums checked
package ‘crayon’ successfully unpacked and MD5 sums checked
package ‘utf8’ successfully unpacked and MD5 sums checked
package ‘farver’ successfully unpacked and MD5 sums checked
package ‘labeling’ successfully unpacked and MD5 sums checked
package ‘lifecycle’ successfully unpacked and MD5 sums checked
package ‘munsell’ successfully unpacked and MD5 sums checked
package ‘R6’ successfully unpacked and MD5 sums checked
package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
package ‘viridisLite’ successfully unpacked and MD5 sums checked
package ‘ellipsis’ successfully unpacked and MD5 sums checked
package ‘fansi’ successfully unpacked and MD5 sums checked
package ‘magrittr’ successfully unpacked and MD5 sums checked
package ‘pillar’ successfully unpacked and MD5 sums checked
package ‘pkgconfig’ successfully unpacked and MD5 sums checked
package ‘vctrs’ successfully unpacked and MD5 sums checked
package ‘digest’ successfully unpacked and MD5 sums checked
package ‘glue’ successfully unpacked and MD5 sums checked
package ‘gtable’ successfully unpacked and MD5 sums checked
package ‘isoband’ successfully unpacked and MD5 sums checked
package ‘rlang’ successfully unpacked and MD5 sums checked
package ‘scales’ successfully unpacked and MD5 sums checked
package ‘tibble’ successfully unpacked and MD5 sums checked
package ‘withr’ successfully unpacked and MD5 sums checked
package ‘ggplot2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\99\AppData\Local\Temp\RtmpEDx6Cz\downloaded_packages
> utils:::menuInstallPkgs()
> setRepositories()
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
> utils:::menuInstallLocal()
package ‘ggplot2’ successfully unpacked and MD5 sums checked
> install.packages("reshape2")
还安装相依关系‘stringi’, ‘plyr’, ‘Rcpp’, ‘stringr’

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/stringi_1.7.6.zip'
Content type 'application/zip' length 16449819 bytes (15.7 MB)
downloaded 15.7 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/plyr_1.8.6.zip'
Content type 'application/zip' length 1499468 bytes (1.4 MB)
downloaded 1.4 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/Rcpp_1.0.7.zip'
Content type 'application/zip' length 3263155 bytes (3.1 MB)
downloaded 3.1 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/stringr_1.4.0.zip'
Content type 'application/zip' length 216753 bytes (211 KB)
downloaded 211 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/reshape2_1.4.4.zip'
Content type 'application/zip' length 818001 bytes (798 KB)
downloaded 798 KB

package ‘stringi’ successfully unpacked and MD5 sums checked
package ‘plyr’ successfully unpacked and MD5 sums checked
package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘stringr’ successfully unpacked and MD5 sums checked
package ‘reshape2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\99\AppData\Local\Temp\RtmpEDx6Cz\downloaded_packages
> utils:::menuInstallLocal()
package ‘reshape2’ successfully unpacked and MD5 sums checked
> install.packages("relaimpo")
还安装相依关系‘minqa’, ‘numDeriv’, ‘DBI’, ‘survey’, ‘mitools’, ‘corpcor’

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/minqa_1.2.4.zip'
Content type 'application/zip' length 855876 bytes (835 KB)
downloaded 835 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/numDeriv_2016.8-1.1.zip'
Content type 'application/zip' length 116205 bytes (113 KB)
downloaded 113 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/DBI_1.1.2.zip'
Content type 'application/zip' length 741793 bytes (724 KB)
downloaded 724 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/survey_4.1-1.zip'
Content type 'application/zip' length 2728411 bytes (2.6 MB)
downloaded 2.6 MB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/mitools_2.4.zip'
Content type 'application/zip' length 298648 bytes (291 KB)
downloaded 291 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/corpcor_1.6.10.zip'
Content type 'application/zip' length 115070 bytes (112 KB)
downloaded 112 KB

试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/relaimpo_2.2-6.zip'
Content type 'application/zip' length 562932 bytes (549 KB)
downloaded 549 KB

package ‘minqa’ successfully unpacked and MD5 sums checked
package ‘numDeriv’ successfully unpacked and MD5 sums checked
package ‘DBI’ successfully unpacked and MD5 sums checked
package ‘survey’ successfully unpacked and MD5 sums checked
package ‘mitools’ successfully unpacked and MD5 sums checked
package ‘corpcor’ successfully unpacked and MD5 sums checked
package ‘relaimpo’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\99\AppData\Local\Temp\RtmpEDx6Cz\downloaded_packages
> install.packages("MASS")
试开URL’https://cloud.r-project.org/bin/windows/contrib/4.1/MASS_7.3-54.zip'
Content type 'application/zip' length 1191296 bytes (1.1 MB)
downloaded 1.1 MB

package ‘MASS’ successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package ‘MASS’
Warning: restored ‘MASS’

The downloaded binary packages are in
        C:\Users\99\AppData\Local\Temp\RtmpEDx6Cz\downloaded_packages
Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
  拷贝D:\R\R-4.1.2\library\00LOCK\MASS\libs\x64\MASS.dll到D:\R\R-4.1.2\library\MASS\libs\x64\MASS.dll时出了问题:Permission denied 
> utils:::menuInstallLocal()
package ‘relaimpo’ successfully unpacked and MD5 sums checked
> remove.packages(c("relaimpo"))
从‘D:/R/R-4.1.2/library’中删除程序包
(因为没有指定‘lib’)
> remove.packages(c("relaimpo"),lib = file .path("path", "to", "library"))
错误: unexpected symbol在"remove.packages(c("relaimpo"),lib = file .path"里
> remove.packages(c("relaimpo"),lib = file.path("path", "to", "library"))
Error in find.package(pkgs, lib) : 不存在叫‘relaimpo’这个名字的程辑包
> remove.packages(c("relaimpo"),lib=file.path("path", "to", "library"))
Error in find.package(pkgs, lib) : 不存在叫‘relaimpo’这个名字的程辑包
> utils:::menuInstallLocal()
package ‘relaimpo’ successfully unpacked and MD5 sums checked
> install.packages("packfor")
Warning message:
package ‘packfor’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 
> utils:::menuInstallLocal()
package ‘R.matlab’ successfully unpacked and MD5 sums checked
> 
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/153542.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • android的layout_android可拖拽layout

    android的layout_android可拖拽layoutViewGroup.LayoutParams介绍LayoutParams携带了子控件针对父控件的信息,告诉父控件如何放置自己LayoutParams类也只是简单的描述了宽高,宽和高都可以设置成三种值:1,一个确定的值;2,FILL_PARENT,即填满(和父容器一样大小);3,WRAP_CONTENT,即包裹住组件就好。每一个ViewGroup(例如LinearLayout,RelativeLa…

    2022年9月21日
    2
  • struts2漏洞复现

    struts2漏洞复现struts2漏洞复现简介Struts2是apache项目下的一个web框架,普遍应用于阿里巴巴、京东等互联网、政府、企业门户网站Struts2是一个基于MVC设计思路的Web应用框架,它本质

    2022年7月1日
    24
  • mybatiscodehelperpro在线激活码【永久激活】

    (mybatiscodehelperpro在线激活码)JetBrains旗下有多款编译器工具(如:IntelliJ、WebStorm、PyCharm等)在各编程领域几乎都占据了垄断地位。建立在开源IntelliJ平台之上,过去15年以来,JetBrains一直在不断发展和完善这个平台。这个平台可以针对您的开发工作流进行微调并且能够提供…

    2022年3月22日
    797
  • Idea激活码最新教程2024.1版本,永久有效激活码,亲测可用,记得收藏

    Idea激活码最新教程2024.1版本,永久有效激活码,亲测可用,记得收藏Idea 激活码教程永久有效 2024 1 激活码教程 Windows 版永久激活 持续更新 Idea 激活码 2024 1 成功激活

    2025年5月27日
    2
  • opencv 人脸识别 (二)训练和识别

    opencv 人脸识别 (二)训练和识别上一篇中我们对训练数据做了一些预处理,检测出人脸并保存在\pic\color\x文件夹下(x=1,2,3,…类别号),本文做训练和识别。为了识别,首先将人脸训练数据转为灰度、对齐、归一化,再放入分类器(EigenFaceRecognizer),最后用训练出的model进行predict。—————————————–环境:vs2010+op

    2022年6月1日
    53
  • redis manager教程_下载万能钥匙并安装

    redis manager教程_下载万能钥匙并安装一、下载RedisDesktopManagerhttps://pan.baidu.com/s/1Jvr9MbgFn4UJh4M1AMo3gA提取码:3i9b二、安装RedisDesktopManager下一步即可三、连接Redis服务器四、RedisDesktopManager的使用

    2022年8月30日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号