R script to create plot1 hist for GAP