How do I create new repository on github using devtools in RStudio? I've tried to:
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?
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With