Streamgraphs in base::R [e.I]

This is the first of a series of four post on producing a streamgraph in plain R code. Here I present a very simple R script plotting a streamgraph. In this post I made streamgraph in d3.js, but I wanted to be able to do the same in R, to not depend on a webpage, or without requiring additional libraries (e.g. the streamgraph htmlwidgtet is only a wrapper around d3, and does not work always smoothly).
Continue reading “Streamgraphs in base::R [e.I]”

Streamgraphs in base::R [e.I]

Citations Network

This post describes the visualisation of a social network I made for a Coursera course on Data Visualisation. For this specific assignment I opted for gathering data on my own rather than using the datasets provided by the course instructor. I wanted to gather the data myself to try to visualise ‘real’ data. With real data I mean data that I try to scrape from the web and visualise. Basically with ‘real’ data I mean what other people call dirty data (i.e. data that is not been processed or polished before use). The question was also whether I could Continue reading “Citations Network”

Citations Network

Color-coded parallel coordinates in R

Parallel coordinates can be very helpful in understanding relationships among more than two variables. The first time I encountered parallel coordinates I did not understand their potential, until I saw Alberto Cairo’s slopegraph. In that slopegraph Cairo color-coded the Continue reading “Color-coded parallel coordinates in R”

Color-coded parallel coordinates in R

Custom colormap for image() in R

Creating a custom colormap in R to plot a matrix is simple:

nsamples <- 20
matrix2plot <- 1:nsamples
dim(matrix2plot) <- c(4, 5)
colors2spaceThrough <- c('red', 'white', 'blue')
customColorMap <- colorRampPalette(colors2spaceThrough)(nsamples)
image(1:4, 1:5, matrix2plot, col = customColorMap)

Continue reading “Custom colormap for image() in R”

Custom colormap for image() in R