Introducing Shiny Gadgets: Interactive Tools

October 13, 2016 Garrett Grolemund

Download Materials

A Shiny Gadget is an interactive tool that enhances your R programming experience. You make Shiny Gadgets with the same package that you use to make Shiny Apps, but you use Gadgets in a very different way. Where Shiny Apps are designed to communicate results to an end user, Gadgets are designed to generate results for an R user. Each Shiny Gadget returns a value that you can immediately use in your code. You use Shiny Gadgets during the course of your analysis to quickly hone iterative tasks in an interactive fashion. For example, you might use a Shiny Gadget to preview the matches that are generated by a regular expression–as you write the expression. Or you might use a Shiny Gadget to identify high leverage points in your model–as you fit the model. Unlike Shiny Apps, Shiny Gadgets do not need to be deployed on a server. Shiny Gadgets are defined right inside of a regular R function. This is important, because it means that Gadgets can directly access the function’s arguments, and the return value of the Gadget can be the return value for the function. Despite this difference, almost everything you know about Shiny Apps will transfer over to writing Shiny Gadgets.

About the Author

Garrett Grolemund

Garrett is a data scientist and master instructor for RStudio. He excels at teaching, statistics, and teaching statistics. He wrote the popular lubridate package and is the author of Hands On Programming with R and the upcoming book, Data Science with R, from O’Reilly Media. He holds a PhD in Statistics and specializes in Data Visualization.

Follow on Twitter Visit Website More Content by Garrett Grolemund
Previous Video
Introducing a bookmarkable state for shiny
Introducing a bookmarkable state for shiny

Users can save the state of an application and get a URL that can be used to return to the application in t...

Next Video
Administration of Shiny Server Pro: share Shiny apps, secure user access, monitor resource utilization
Administration of Shiny Server Pro: share Shiny apps, secure user access, monitor resource utilization