Constructing RStudio add-ins
RStudio add-ins are one of the newest and most promising developments introduced recently by the RStudio team. They add infinite possibilities for improvement to users' workflows through the enhancement of their IDE.
There are two main types of add-ins:
Text macros: These only produce a text insertion within your code (for instance the
(){
} structure to be added after thefunction
token).Shiny gadgets: These are little Shiny apps that are shown within the viewer pane, a pop-up window, or a browser window. They let you perform advanced activities such as statistical parameter definition or data-wrangling tasks.
In this example, we will develop the second type of add-in from the function definition, for deployment and installation as a package on GitHub.
Our example will be a funny one: we will develop an add-in that lets you see weather forecasts for a specified city within the R console.
Getting ready
Let's first install the shiny
and miniUI
packages:
install.packages...