R script to plot citations