How to install a specific version of a package in R

这篇具有很好参考价值的文章主要介绍了How to install a specific version of a package in R。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

在使用R语言完成数据分析的过程中,很多时候,因为项目实际需要,我们应该指定某些库文件的安装包的版本,这个时候,我们可以基于devtools包中的函数install_version来完成。

这里,我们以安装库文件ggplot2的安装包的版本号为3.3.6为例来说明,即

devtools::install_version("ggplot2",version = "3.3.6",repos = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/")

说明如下:

  • version

版本号

  • repos

仓库地址,这里将其指定为清华大学开源镜像站的地址

devtools::install_version("ggplot2",version = "3.3.6",repos = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/")
Downloading package from url: https://mirrors.tuna.tsinghua.edu.cn/CRAN//src/contrib/Archive/ggplot2/ggplot2_3.3.6.tar.gz
Installing package into ‘/home/lwk/R/x86_64-pc-linux-gnu-library/4.3(as ‘lib’ is unspecified)
* 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
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ggplot2)

参考文献文章来源地址https://www.toymoban.com/news/detail-832985.html

  • Installing older versions of packages
  • R 3.2.3 devtools::install_version() fails (.zip file not found)

到了这里,关于How to install a specific version of a package in R的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • up to date, audited 1 package in 719msfound 0 vulnerabilities npm installnpm install node_modules没有生

    D:迅雷下载Student-Work-Management-System-mainStudent-Work-Management-System-mainnpm install up to date, audited 1 package in 719ms found 0 vulnerabilities  解决方法: 切换到这个目录执行  npm install 这个目录才是前端项目根目录

    2024年02月05日
    浏览(41)
  • How to manually install PCL on ubuntu 18.04

    1. Firstly, need to check which version pcl you need to install on your ubuntu system. PCL download link: https://github.com/PointCloudLibrary/pcl/releases?page=2 https://github.com/PointCloudLibrary/pcl/releases?page=2 Find your version: pcl-1.9.1  Then click Assets, and download the source code.zip 2. unzip source_code.zip 3. cd source_code 4. 5.  6. 7. 

    2024年01月21日
    浏览(43)
  • 已解决The following specifications were found to be incompatible with the existing python installation

    已解决The following specifications were found to be incompatible with the existing python installation 下滑查看解决方法 The following specifications were found to be incompatible with the existing python installation 对于 “The following specifications were found to be incompatible with the existing python installation” 的问题有几种可能

    2024年02月08日
    浏览(30)
  • You must install at least one postgresql-client-<version> package

    使用主机上的映射端口来连接到 PostgreSQL 数据库。例如,使用以下命令连接到数据库: 出现下面的问题: 分析: 如果您在运行 psql 命令时遇到错误消息 You must install at least one postgresql-client-version package ,这意味着您的系统缺少 PostgreSQL 客户端工具。 要解决这个问题,您需要

    2024年02月10日
    浏览(27)
  • how to read dwarf in linux

    Makefile demo.c

    2024年02月16日
    浏览(34)
  • How to implement markdown syntax in notion?

      Notion is a powerful productivity tool that enables you to organize your life, work, and ideas in one place. It supports a variety of formatting options, including Markdown, which can be used to add structure and emphasis to your text. Here are some ways you can implement Markdown syntax in Notion:   Also, Markdown shortcuts automatically format as

    2024年02月12日
    浏览(35)
  • How to use notebook in Ubuntu 22.04

    这个时候,系统会自动打开浏览器,浏览器会自动跳转到页面http://localhost:8888/tree,如下图所示: 如果我们希望停止服务运行,可以在终端窗口中按Ctrl+C,这个时候,终端窗口命令行会出现如下变化 我们再来观察notebook浏览器画面,发现没有任何变化。

    2024年02月10日
    浏览(32)
  • How to use jupyterlab in Ubuntu 22.04

    这个时候,系统会自动打开浏览器,页面会自动跳转到http://localhost:8888/lab页面。 在终端窗口中按Ctrl+C 切换到浏览器,我们将会看到下面的画面

    2024年02月11日
    浏览(35)
  • How to disable certificate validations in the Java HTTP Client

    Java 11 introduced the HTTP Client, an API that made it easier to send HTTP requests with vanilla Java. By default, it throws an exception if there are certificate path or hostname verification errors in the request. Let’s see how to bypass certificate validations for cases where this is really necessary. To ignore both certificate path and hostname verif

    2024年01月19日
    浏览(37)
  • How to understand the Trusted Intelligent Computing Service in Huawei Cloud

      可信智能计算服务TICS( Trusted Intelligent Computing Service )打破数据孤岛,在数据隐私保护的前提下,实现行业内部、各行业间的多方数据联合分析和联邦计算。TICS基于安全多方计算MPC、区块链等技术,实现了数据在存储、流通、计算过程中端到端的安全和可审计,推动了

    2024年02月03日
    浏览(38)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包