问题
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