How to get help

Writing code can be tricky. Sometimes you will want more advice than you can find in R’s help pages. This article will show you where to seek help, how to get it.
Authors

Garrett Grolemund

Mine Cetinkaya-Rundel

Published

September 15, 2017

Writing code can be tricky. Sometimes you will want more advice than you can find in R’s help pages.

This article will show you where to seek help, how to get it.

Support for R and Shiny has developed like the languages themselves, organically and through the excellent work of volunteers. You can be a part of this process. Simply ask your questions in the right places and in a clear manner. Not only will your question help you, it will create a record that will benefit everyone who has the same question later.

Where to seek help

You will get the quickest response if you submit your question to a place that people already visit to ask and answer similar questions. We recommend these resources for questions on the following topics:

1Since Posit Connect and Shiny Server Pro are paid products, they have a dedicated customer support team.

These sites all have archives that you can search to see if your question has already been answered. If answered, you can get an immediate solution!

Once answered your question will go into these archives and expand the knowledge base in the Shiny community.

How to get help

You will get the most useful help if you do these simple things:

  1. Search the archives and check if your question has an answer already.
  2. Write a minimal reproducible example that illustrates your problem.
  3. Be precise. Include the exact error messages that you see.
  4. Run sessionInfo() in R and include the output with your question (sessionInfo() displays the versions of R and its packages that you are using, as well as your OS. This is important information for debugging).
  5. Be friendly and appreciative.

These steps will make it easier for a mentor to help you.

How to write a good reproducible example

A reproducible example is a snippet of R code that someone can run and recreate your problem. Many bugs cannot be diagnosed unless you include the code that causes them.

A good reproducible example is:

  1. Minimal - It should contain just enough code to recreate the bug. This will help both you and your mentors zero in on the problem.
  2. Complete - It should contain everything a person needs to recreate the bug. In other words, a person should be able to copy and paste the code into R and see the bug.

You do not need to share your own code and data (if you do not want to). Often you can create an example that reproduces your bug with toy code and a dummy data set.

If you need to create a reproducible example of a Shiny app, we recommend you save your app as a gist. When you write your question, include the runGist command that will launch your app. A runGist command looks like this:

shiny::runGist("eb3470beb1c0252bd0289cbc89bcf36f")

Don’t forget to explain how to create the error in your app. You may need to provide instructions such as “Click this checkbox” or “Select this value.”

If you need to create a reproducible example of Rcpp code, we recommend you supply a .cpp file that can be executed through Rcpp::sourceCpp. It is the easiest way of testing or debugging C++ / Rcpp code.

If you want more details on writing a good example, Hadley gives some advice here.

What about the Shiny Dev Center?

RStudio wants to make the Shiny Dev Center as useful as possible. We hope it can be a one stop shop for advice, wisdom, and inspiration. However the Shiny Dev Center is not designed to be an interactive resource.

If you ask a question about an article or tutorial in its comments section, we will try our best to answer it there. However, the comments section is not a good place to ask for specific help with your code. Why not?

  • Practicality - Volunteers do not hang out in the comments sections waiting to answer your questions.
  • Efficiency - The resources listed above are searchable and well known, which makes it easy for others to benefit from your questions and answers. Not so for the comments.
  • Redundancy - There is a good chance someone already answered your question at one of the help sites. Why not find out?

Recap

You can get the help you need and make Shiny better in the process by visiting a help site specific to your question. Do not forget to make your question clear with a reproducible example, an error message, and the output of sessionInfo().