[英]Start new R package development on github
How do I create new repository on github using devtools in RStudio? 如何使用RStudio中的devtools在github上创建新的存储库? I've tried to:
我试过:
Then I thought I will use create("MyNewRPackage")
to initialize directory structure and README.md
file. 然后我想我会使用
create("MyNewRPackage")
来初始化目录结构和README.md
文件。 But the package skeleton is created as subfolder of my project and I have ~/MyNewRPackage/MyNewRPackage/R
. 但是包骨架被创建为我项目的子文件夹,我有
~/MyNewRPackage/MyNewRPackage/R
But I need to create package skeleton in the root folder of my github repository. 但我需要在我的github存储库的根文件夹中创建包骨架。
What is the standard way to start new R package development on github using devtools and RStudio? 使用devtools和RStudio在github上开始新R包开发的标准方法是什么?
Hope this helps someone: 希望这有助于某人:
rpackage
in this example) rpackage
) create("rpackage")
(this will create rpackage folder) create("rpackage")
(这将创建rpackage文件夹) rpackage
directory rpackage
目录 git init
git init
Start Git/More/Shell and type 启动Git / More / Shell并键入
git add *
git commit -m "first commit"
git remote add origin git@github.com:[username]/rpackage.git
git push -u origin master
Then you can refresh repository on github
. 然后你可以在
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 现在您可以关闭(甚至删除)本地项目,下次可以启动新项目Project / New project / Version Control / Git
You can specify the path to your github repository in create
instead of the package name: 您可以在
create
指定github存储库的路径而不是包名:
create("/path/to/root/of/repository")
Then the normal git commands to add, commit and push to github: 然后是正常的git命令来添加,提交和推送到github:
git commit -a -m "initial commit" *
git push
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.