Update: I'm about to post an updated response, incorporating some feedback and in light of usethis changes made as a result of this productive discussion!
I think this is easiest:
- Create repo on GitHub (YES to Initialize this repository with a README)
- Capture URL from the big green "Clone or download" button
- Make a new RStudio Project with this URL
-
usethis::create_package(getwd())
(hmm ... maybe that should be less awkward?). Note: usethis is not on CRAN yet.
Sticking to CRAN packages does involve a bit more friction.
The "GitHub first" approach:
- Create repo on GitHub (YES to Initialize this repository with a README)
- Capture URL from the big green "Clone or download" button; new RStudio Project from that
devtools::setup()
- Quit and Relaunch RStudio in this Project.
The "GitHub last" approach:
- From a running RStudio instance:
devtools::create("path/to/your/new/pkg")
. - Also from the existing RStudio instance:
browseURL("path/to/your/new/pkg.Rproj")
to launch a new instance of RStudio in the new pkg/Project. - In the new pkg/Project,
devtools::use_github()
.