Quantcast
Channel: r software hub
Viewing all articles
Browse latest Browse all 1015

An awesome RStudio addin for selecting colours, and another for adding marginal density plots to ggplot2

$
0
0

By Dean Attali’s R Blog

Colour picker screenshot

TL;DR: There’s a colour picker addin in shinyjs and a ggplot2 marginal plots addin in ggExtra.


Any R user who hasn’t been spending the past 2 months under a rock should know by now about RStudio’s new exciting features: addins and gadgets.

(In case you don’t know, here’s a summary: Gadgets are simply Shiny apps that return a value, and are therefore meant to be used by the programmer to assign a value to a variable rather than by an end-user. Addins are a way to add your own clickable menus in RStudio that call R functions upon being clicked.)

From the moment I saw the announcement about gadgets and addins, I was excited to try them out. Unfortunately, I’ve been pretty tied up with wrapping up my thesis, so I didn’t get too much play time. I’m happy to finally announce the two addin+gadget pairs I’ve been working on: a colour picker and a tool to add marginal density plots to ggplot2.

Colour picker

A colour picker gadget and addin are available in the shinyjs package.

Screenshot:

Some of you may already know that shinyjs provides a colourInput() function, which is a Shiny input widget that lets you select a colour (demo). The idea of the colour picker gadget is to extend this idea of a colour input and provide R developers with an easy way to select colours. It’s perfect if you want to choose a colour/a vector of colours to use for a plot or for anything else that requires a careful selection of colours.

You can either run the colour picker as an addin or as a gadget. To access it as an addin, click on the RStudio Addins menu and select Colour Picker. To access the colour picker gadget, run the colourPicker() function. When running the gadget, you can …read more

Source:: r-bloggers.com


Viewing all articles
Browse latest Browse all 1015

Trending Articles