class: center, middle, inverse, title-slide # Publishing and Promoting your R Package ### Heather Turner ### May 16, 2018 --- # Not yet written a package? Take a look at these resources! - Earo Wang's R-Ladies talk "Everything you need to know to create your own R package" https://github.com/earowang/rladies-pkg - Maƫlle Salmon's satRdays workshop https://github.com/maelle/satrday_package_workshop - Forwards Package Development Workshop https://github.com/forwards/workshops/tree/master/eRum2018 --- # Why publish on CRAN? - Sign of quality - Code is ready to be used (not a beta version) - Basic standards: documented code, running examples, etc - Works with current version of R and other packages - Commitment of maintainer - Discoverability - Ease of installation - Bioconductor, rOpenSci: even higher standards, code review --- # Preparing for CRAN release - Hadley Wickham's R Packages give good advice: http://r-pkgs.had.co.nz/release.html - Useful functions for additional checks: - `goodpractice::gp` - `spelling::spell_check_package` - Use **rhub** to test on different platforms, particularly R-devel - Test *built* package with option `--as-cran` ```r pkg <- "BradleyTerry2_1.0-8.tar.gz" check_with_rdevel(path = pkg, check_args = "--as-cran") ``` --- # Promoting your package - Some promotion will/may be done for you: CRANberries, R Views Package Picks, search engines (vignette/pkgdown site) - Some channels are obvious: website, blog, Twitter (#rstats) - Consider RPubs or gist for one-off tutorial/case study, e.g. - https://gist.github.com/sckott/08de710da349e48ede3e - https://rpubs.com/mdbrown/TreatmentSelection - Publicize your new package via R Weekly https://rweekly.org/ - Add to the weekly news blog, see [CONTRIBUTING](https://github.com/rweekly/rweekly.org/blob/gh-pages/CONTRIBUTING.md), and example pull requests [new package](https://github.com/rweekly/rweekly.org/pull/279), [new version](https://github.com/rweekly/rweekly.org/pull/277). - Submit an audio clip/script for the podcast via the [form](https://blog.rweekly.org/submit-audio.html) - Would your package fit in a CRAN Task View? https://cran.r-project.org/web/views/ - Check description for how to propose addition --- # Talks - Meetups: RUGs, R-Ladies, satRdays - Conferences (https://jumpingrivers.github.io/meetingsR/events.html) - **General**: useR!, rstudio::conf, EARL, eRum - **Specific**: R/Finance, R in Insurance, Bioconductor, [Psychoco](https://eeecon.uibk.ac.at/psychoco/) - **Non R-specific**: JSM, ESA, ... - Conferences provide greater exposure, particular to people working in relevant field(s). - Don't forget to share your slides! (Conference/personal website, LinkedIn, RPubs, Slideshare) --- # Paper - A paper not only promotes your package but benefits from peer review - Paper can also overlap with vignette - Traditional journals: - **Open Source Software**: The R Journal, Journal of Statistical Software - **Computing**: Computational Statistics and Data Analysis, Journal of Computational and Graphical Statistics, SoftwareX - **Science**: Bioinformatics, PLOS ONE, Method in Ecology and Evolution - Alternative journals: - F1000research Bioconductor/R package gateway: publish, then open review - Journal Open Source Software: open code review, short descriptive paper --- # Research compendium - A *research compendium* can showcase your work in a reproducible workflow - Could demonstrate a protocol/pipeline vs research study. - Advice on how to structure a research compendium is given by rOpenSci: https://github.com/ropensci/rrrpkg - The research compendium can be published on Zenodo, Figshare or Dryad - DOI points to a particular version (e.g. matching results in a paper) - Example using R: https://zenodo.org/record/61312#.WfnvS3BpFWO --- # Interacting with users - Add a `BugReports` url to your `DESCRIPTION` - Using GitHub issues means that people can see if bug already reported and what action has been taken - Consider creating an RSS feed for relevant StackOverflow questions - DIY based on search terms: https://meta.stackexchange.com/a/238460 - Based on package tag (requires >1,500 reputation to add tag) - Bug reports/help requests - Can show where documentation/tests need improving - Help you find out who's using your package and what for - Can give ideas for new features - Can lead to collaborations --- # Interacting with developers - Add a `CONTRIBUTING.md` to your GitHub repository - Do you have a style guide? - Reminders to run check/tests/add NEWS item to pull requests - Use tags to highlight issues: the following are promoted by GitHub - `help wanted` - `good first issue` - Add a code of conduct: make sure everyone knows ground rules for happy collaboration and a welcoming community - `devtools::use_code_of_conduct` adds Contributor Covenant - Be prepared to enforce! --- # Don't keep it to yourself! <img id="anim" src="http://media3.giphy.com/media/lShOQ8lMmoHqE/200.gif" style="width:800px;height:400px;">