CRAN contains heaps of packages but obviously there are even more goodies on GitHub. If you want to access it you need to download/install things manually. At least, that’s the standard way and you can avoid this tedious process by using Pacman, the comprehensive package manager. Pacman itself can be installed in the usual easy way in RStudio and thereafter you can use things like

which stands for ‘load package from GitHub’. Way better than the manual route. If you use the simple

it will install the “deployer” package from CRAN. Updating the whole local set of packages goes like so

Well, after using it for a while I concluded that all of this should be standard in R really. You get easily used to it.

Random data. Love it. Both from a scientific point of view and for the sensation of productivity it gives you, it’s handy to have a generator around. Meet Wakefield, a great package with tons of random data generators. For instance, this

creates a 500-rows data frame with random data using the specified column types. On top of that, there is a nice heat-map visualization of the NA’s in this type of frame. If you use

it will result in

Wakefield Heatmap

Next up is the dygraphs package which creates interactive timelines charts. Plain awesome. The kinda stuff that you also have in typical development control suites, but easier to create. Something as simple as (note the usage of dplyr here)

generates this
dygraphs
it can be zoomed, panned, the time range can be adjusted and whatnot. Ain’t it cool. This widget is actually part of a larger effort to bring a whole JavaScript world to R. The claim being that HTML widgets for R

…bring the best of JavaScript data visualization to R…

and thus

  • use JavaScript visualization libraries at the R console, just like plots
  • embed widgets in R Markdown documents and Shiny web applications
  • develop new widgets using a framework that seamlessly bridges R and JavaScript

What not to like about the following example

leading to a rather familiar d3js force-directed diagram

Network D3

Then, there is this concise piece of code

London flows

Well, if you read this you won’t probably need this one but I include it because I admire the effort of some people to get other on board of the R-train. The Swirl package creates an interactive tutorial environment inside RStudio


Swirl R

Chord diagrams have been popularized largely by D3js and, yes, you can do it in R as well. Things are less interactive than in JavaScript but I still find it kinda baffling how much one can do in R with little code;

Chords diagrams in R

Sankey diagrams anyone? Navigate to this page and copy a dozen lines of R-code to get the following diagram

Sankey diagram in R