There are many benefits to teaching undergraduate statistics with R–especially in the RStudio environment–but it must be admitted that the learning curve is fairly steep, especially when it comes to tinkering with plots to get them to look just the way one wants. If there were ever a situation when I would prefer that the students have access to a graphical user interface, production of plots would be it.
You can, of course, write Shiny apps like this one, where the user controls features of the graphs through various input-widgets. But then the user must visit the remote site, and if he or she wishes to build a graph from a data frame not supplied by the app, then the app has to deal with thorny issues surrounding the uploading and processing of .csv files, and in the end the user still has to copy and paste the relevant graph-making code back to wherever it was needed.
It would be much nicer if all of this could be accomplished locally. mPlot()
in package mosaic
does a great job in this respect by taking advantage of RStudio’s manipulate
package. However, manipulate
doesn’t offer much flexibility in terms of control of inputs, so it’s not feasible within the manipulate
framework to write a code-helper that allows much fine-tuning one’s plot.
Addins (a new feature in the current RStudio Preview Version) permit us to have the best of both worlds. An Addin works like a locally-run Shiny app. As such it can draw on information available in the user’s R session, and it can return information directly to where the user needs it in a source document such as an R script or R Markdown file.
addinplots is a package of Addins, each of which is a code-helper for a particular …read more
Source:: r-bloggers.com