How to load a git branch from another R package

烈酒焚心 提交于 2021-02-11 14:02:30

问题


In R, how I load one package's git branch from another package?

There are two packages, call them producer and consumer1. I am refactoring my code by moving a bunch of function definitions and tests from producer to consumer1.

I'm creating git branches, rfctrProd and rfctrCons1 for producer and consumer1. In rfctrCons1, I need a statement doing something like

#` @import producer, gitBranch = rfctrProd

Also, I'll to do similarly with other packages which import producer, to make sure I haven't broken them either. (I think the functions I'm refactoring are only used by consumer1, but I want to be sure before I merge my changes.)


回答1:


You don't use roxygen comments to specify the import branch, just the functions themselves. You can specify the branch in the DESCRIPTION file, under Remotes:. Assuming it's Github (the default), you can do:

Remotes:
  username/producer/rfctrProd

If it's not Github, have a look here for the other syntax.



来源:https://stackoverflow.com/questions/61461900/how-to-load-a-git-branch-from-another-r-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!