Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isteves/r-pkg-intro
How to create an R package
https://github.com/isteves/r-pkg-intro
Last synced: about 2 months ago
JSON representation
How to create an R package
- Host: GitHub
- URL: https://github.com/isteves/r-pkg-intro
- Owner: isteves
- Created: 2018-04-09T20:05:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-17T06:30:58.000Z (over 6 years ago)
- Last Synced: 2024-08-13T07:13:34.078Z (4 months ago)
- Language: R
- Homepage: https://isteves.github.io/r-pkg-intro/Presentation.html
- Size: 2.91 MB
- Stars: 25
- Watchers: 2
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - isteves/r-pkg-intro - How to create an R package (R)
README
[![Travis-CI Build Status](https://travis-ci.org/isteves/r-pkg-intro.svg?branch=master)](https://travis-ci.org/isteves/r-pkg-intro)
# How to create an R package :package:
Check out the [slidedeck](https://isteves.github.io/r-pkg-intro/Presentation.html#/) to quickly build your first package! :palm_tree: :sunny: :ocean:
**Here's an alternate Git/RStudio workflow you can use to get your package started:**
1. Create an new GitHub repo on https://github.com/new
2. Create a new Git R project (File --> New Project --> Version Control --> Git --> [paste in Repository URL] & [Create Project])
3. Use `devtools::create(".")` to initiate a package. You can say "no" when it asks you to overwrite the RProj file.# Other tips and resources
Also check out these guides to package development in R:
- [Writing an R package from scratch](https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/) blogpost by Hilary Parker
- [R packages](http://r-pkgs.had.co.nz/) book by Hadley Wickham
- [R packages cheatsheet](https://www.rstudio.com/wp-content/uploads/2015/03/devtools-cheatsheet.pdf)
- Official [writing R extensions](https://cran.r-project.org/doc/manuals/R-exts.html#Creating-R-packages) guideHere are some other great **packages** you may want to check out:
- [usethis](https://github.com/r-lib/usethis)
- [goodpractice](https://github.com/MangoTheCat/goodpractice)
- [styler](https://github.com/r-lib/styler) for auto-style checking
- [lintr](https://github.com/jimhester/lintr) for style - use with Travis to auto-check your code!
- [pkgdown](https://github.com/r-lib/pkgdown) for creating a website for your packageAnd some **keyboard short-cuts**:
- *Cmd + i* = auto-indent
- *Cmd + opt + shift + r* = auto-generate roxygen skeleton
- *Cmd + shift + t* = `devtools::test()`
- *Cmd + shift + d* = `devtools::document()`If you are on Windows, Use `Ctrl` in the place of `Cmd` for the above shortcuts work.
Other reading/resources:
- [Unix Design Philosophy](http://wiki.c2.com/?UnixDesignPhilosophy) - design principles to think about when designing software/etc; many points are echoed in the [R packages book](http://r-pkgs.had.co.nz/)