在github上开始新的R包开发 [英] Start new R package development on github

查看:149
本文介绍了在github上开始新的R包开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在RStudio中使用devtools在github上创建新的存储库?我尝试过:

How do I create new repository on github using devtools in RStudio? I've tried to:


  1. 在github上创建名为MyNewRPackage的空存储库

  2. 项目在RStudio中使用ssh连接到我的git仓库
  3. 安装并加载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:


  1. 在github上创建空的存储库(在本例中,我将使用名称 rpackage
  2. 使用devtools在本地创建包创建(rpackage)(这将创建rpackage文件夹)
  3. 在RStudio中创建新项目(从现有目录创建项目)并选择 rpackage 目录

  4. 在RStudio中,进入Tools / Shell ...并键入 git init

  5. 重新打开项目(这将刷新Git选项卡)
  6. 启动Git / More / Shell并键入

  1. Create empty repository on github (I will use name rpackage in this example)
  2. Create package locally using devtools, create("rpackage") (this will create rpackage folder)
  3. Create new project in RStudio (Create project from: Existing directory) and choose rpackage directory
  4. In RStudio go to Tools/Shell... and type git init
  5. Reopen the project (this will refresh the Git tab)
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆