added histograms and density plots in R code