简体   繁体   English

如何安装R包github存储库的开发版本

[英]How to install development version of R packages github repository

How can I install a package that is under development directly from a github repository and once installed how can I switch between development and CRAN versions? 如何直接从github存储库安装正在开发的软件包,一旦安装,如何在开发和CRAN版本之间切换?

The specific package I am interested in installing from git is ggplot2. 我有兴趣从git安装的特定包是ggplot2。

via Hadley at https://github.com/hadley/ggplot2 通过Hadley访问https://github.com/hadley/ggplot2

 install.packages("devtools") library(devtools) dev_mode(on=T) install_github("hadley/ggplot2") # use dev ggplot2 now # when finished do: dev_mode(on=F) #and you are back to having stable ggplot2 

I have the feeling that both previous answers miss the point of your question. 我觉得以前的两个答案都错过了你的问题。

Consider this: 考虑一下:

  • You can control where to install packages via arguments to both R CMD INSTALL (via -l ) and install.packages() . 您可以通过参数R CMD INSTALL (通过-l )和install.packages()来控制安装包的位置。

  • At run-time, you can control where to load packages from via .libPaths() . 在运行时,您可以通过.libPaths()控制从何处加载包

So it really is just a matter of setting a few variables in your .Rprofile (or alike) to control this. 因此,只需在.Rprofile (或类似)中设置一些变量来控制它。

for compile binaries install: 用于编译二进制文件安装:

install.packages('xxx', repo='http://repo_adress')

for source install : 用于源安装:

install.packages('xxx', repo='http://repo_adress', type='source')
devtools::install_github("ggplot2")

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

相关问题 从github存储库安装开发版R包时如何指定lib目录 - How to specify lib directory when installing development version R Packages from github repository R的lightgbm开发版怎么安装? - How to install the development version of lightgbm for R? 如何在 Docker 中安装 R Github 包 - How do I Install R Github packages inside Docker 以木瓜为例,github被屏蔽时如何安装R包 - How to install R packages when github is blocked using papaja as an example "/bin/sh: XX: command not found" 尝试从 github 安装开发版 R fst package 时出错 - "/bin/sh: XX: command not found" error when trying to install development version of R fst package from github 如何通过configuration.nix安装R和包以及如何从github添加包? - How to install R and packages through configuration.nix and how to add packages from github? 安装旧的R软件包的二进制版本? - Install binary version of old R packages? 如何继续使用R版2.x并自动下载包与install.packages()包名? - How to keep using R version 2.x and download packages automatically with install.packages() by package name? 如何在R或Rstudio中安装软件包 - How to install packages in R or Rstudio 如何在 R 3.1.3 中安装软件包? - How to install packages in R 3.1.3?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM