在github上开始新的R包开发 [英] Start new R package development on github
问题描述
如何在RStudio中使用devtools在github上创建新的存储库?我尝试过:
How do I create new repository on github using devtools in RStudio? I've tried to:
- 在github上创建名为MyNewRPackage的空存储库
- 项目在RStudio中使用ssh连接到我的git仓库
- 安装并加载devtools
然后我我认为我将使用 create(MyNewRPackage)
来初始化目录结构,并使用 README.md
文件。但是包骨架被创建为我的项目的子文件夹,并且我有〜/ MyNewRPackage / MyNewRPackage / R
。但是我需要在我的github仓库的根文件夹中创建包骨架。
Then I thought I will use create("MyNewRPackage")
to initialize directory structure and README.md
file. But the package skeleton is created as subfolder of my project and I have ~/MyNewRPackage/MyNewRPackage/R
. But I need to create package skeleton in the root folder of my github repository.
使用devtools和RStudio在github上启动新的R包开发的标准方式是什么? / p>
What is the standard way to start new R package development on github using devtools and RStudio?
推荐答案
希望这可以帮助别人:
Hope this helps someone:
- 在github上创建空的存储库(在本例中,我将使用名称
rpackage
)
- 使用devtools在本地创建包
创建(rpackage)
(这将创建rpackage文件夹)
- 在RStudio中创建新项目(从现有目录创建项目)并选择
rpackage
目录 - 在RStudio中,进入Tools / Shell ...并键入
git init
- 重新打开项目(这将刷新Git选项卡)
-
启动Git / More / Shell并键入
- Create empty repository on github (I will use name
rpackage
in this example) - Create package locally using devtools,
create("rpackage")
(this will create rpackage folder) - Create new project in RStudio (Create project from: Existing directory) and choose
rpackage
directory - In RStudio go to Tools/Shell... and type
git init
- Reopen the project (this will refresh the Git tab)
Start Git/More/Shell and type
git add *
git commit - mfirst commit
git remote add origin git@github.com:[usern ame] /rpackage.git
git push -u origin master
然后,您可以刷新 github
中的存储库。现在你可以关闭(甚至删除)你的本地项目,下次你可以开始一个新项目Project / New project / Version Control / Git
Then you can refresh repository on github
. Now you can close (or even delete) your local project and next time you can start a new project Project/New project/Version Control/Git
这篇关于在github上开始新的R包开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!