R script for visualising data