-
Notifications
You must be signed in to change notification settings - Fork 0
Session 5 guide
Selin Jessa edited this page May 25, 2020
·
10 revisions
- 20 min: debugging and questions
- 10 min: vignettes
- Intro (why, tour, building locally, pkgdown)
- Demo of creating the first vignette with
usethis::use_vignette()
, following https://r-pkgs.org/vignettes.html#vignette-workflow
- 10 min: packaged data
- Intro (why, examples, internal vs. external, documentation)
- Demo of saving some new data with
usethis::use_data_raw()
andusethis::use_data()
, following https://r-pkgs.org/data.html#data-data
- Run through the whole branch/commit/PR workflow once again
Requirements: it's not absolutely necessary, but the 📦 {usethis} package is a great help for working w/ vignettes & package data.
Following the same workflow as before:
- Create an issue describing your new feature
- Pull changes to the sandbox repo
- Branch from
develop-private
& checkout to the issue branch - Make changes, add, commit
- Rebase onto
develop-private
- Push changes
- Watch the Travis status check, and debug until it passes (repeat steps 4, 6, 7 as needed until the commit gets a ✅)
- Open a pull request with
develop-private
(NOTmaster-private
) as the base branch
This time,
- Add to the vignette, demo-ing one or both of the functions you created over the last few weeks, by editing
vignettes/sandbox-demo.Rmd
. (To make a new vignette, you would runusethis::use_vignette("my-vignette")
- you can try this out) - "Create"* some data, add it to the package, and document it, using
usethis::use_raw_data("my-dataset")
followed byusethis::use_data("my-dataset")
, and then documenting it in the file in theR
directory, calleddata.R
That's it! 🎉 Congrats, now you know everything you need to be an R package developer! ✨
* Doesn't have to be fancy, you can make a vector, manipulate the mtcars
or iris
datasets, get some values from rnorm()
, etc!
This book is awesome: https://r-pkgs.org/