Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start new R package development on github

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

  1. Create empty repository on github named "MyNewRPackage"
  2. Started new project in RStudio using ssh connection to my git repository
  3. Installed and loaded devtools

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.

What is the standard way to start new R package development on github using devtools and RStudio?

like image 620
Tomas Greif Avatar asked Jul 08 '13 07:07

Tomas Greif


People also ask

How do I create a new package in R?

To get started on a proper R package complete with documentation, the best thing to do is to create a new R project. To do this in Rstudio, go to File > New Project... ; the box below should pop up. Note that we could have started with a project right away, creating a new folder with the New Directory option.


1 Answers

Now there's setup(), which creates the skeleton inside an existing directory. Together with hub, this becomes:

git init NewPackage
cd NewPackage
Rscript -e "devtools::setup()"
hub create
git add .
git commit -m "initial"
git push -u origin HEAD
like image 66
krlmlr Avatar answered Oct 17 '22 01:10

krlmlr