#RStats hivemind:

What is current best practice for including a shiny interface within a package?

Anyone know of a good example?

@coolbutuseless Some Bioconductor packages have this. Just check the reverse dependencies, if they are on Bioconductor they are in a different color. Also you could check the packages that won the shiny contest in the last years.
@coolbutuseless Not sure if if this answeres your question, but I think following the golem or leprechaun frameworks could be considered good practice. In both frameworks the package exports a run function that returns the shiny interface. The remainder of the shiny app is in internal functions. See for example: https://leprechaun.opifex.org
leprechaun

@friessn @coolbutuseless I'd agree with using those frameworks as the best practice. Here's an example dashboard built with golem: https://github.com/JohnCoene/coronavirus

Engineering Production Grade Shiny Apps book by Colin Fay is a great resource.

GitHub - JohnCoene/coronavirus: 🦠 Novel Coronavirus (COVID-19) Tracker

🦠 Novel Coronavirus (COVID-19) Tracker. Contribute to JohnCoene/coronavirus development by creating an account on GitHub.

GitHub

@coolbutuseless I wouldn’t call it a *good* example, but I have mine just called as a function that wraps shiny::shinyApp()

Does everything I need in ~75 lines

https://github.com/AlexAxthelm/nonogramr/blob/main/R/shiny_app.R

nonogramr/R/shiny_app.R at main · AlexAxthelm/nonogramr

Work with nonogram puzzles in R. Contribute to AlexAxthelm/nonogramr development by creating an account on GitHub.

GitHub
@coolbutuseless I am not claiming to be best practice, but nevertheless the pkgsearch package has a shiny app.
@coolbutuseless @gaborcsardi the testthat package also has a (little) shiny app. Not sure if there is a defined best practice at this stage.

@jameslairdsmith @coolbutuseless @gaborcsardi {blogdown} includes a new_post shiny widget that I can't immediately trace the source of.

For non-CRAN packages I've just put the app in inst/shiny/app/ but I can't speak to the "right" approach.

@jonocarroll @jameslairdsmith @coolbutuseless @gaborcsardi I used the {blogdown} widget as the basis for a new post widget for {distilltools}. Here’s the PR for it, should make tracing the relevant bits of the shiny app easier. I don’t know how current everything here is though (e.g., {miniUI} hasn’t been updated in 6 years): https://github.com/EllaKaye/distilltools/pull/12/files?file-filters%5B%5D=.R&file-filters%5B%5D=.dcf&file-filters%5B%5D=.yml&show-viewed-files=true
Add RStudio addin for interactively creating a new post from a template by mccarthy-m-g · Pull Request #12 · EllaKaye/distilltools

Cool package! I'm in the midst of creating a distill blog and really like the vision of this. I wanted to contribute with something users will likely find helpful: I've created an RStudio a...

GitHub
1  Packaging Guide – rOpenSci Packages: Development, Maintenance, and Peer Review

Guide for package authors, maintainers, reviewers and editors in rOpenSci software peer-review system. This book is a guide for authors, maintainers, reviewers and editors of rOpenSci. The first section of the book contains our guidelines for creating and testing R packages. The second section is dedicated to rOpenSci’s software peer review process: what it is, our policies, and specific guides for authors, editors and reviewers throughout the process. The third and last section features our best practice for nurturing your package once it has been onboarded: how to collaborate with other developers, how to document releases, how to promote your package and how to leverage GitHub as a development platform. The third section also features a chapter for anyone wishing to start contributing to rOpenSci packages.

@kaio @coolbutuseless tabulizer, now tabulapdf, let's you extract areas with a shiny interface. Very useful! https://docs.ropensci.org/tabulapdf/reference/extract_areas.html
extract_areas — locate_areas

Interactively identify areas and extract