Adding quality dropoff R script (originally written by Mari Niemi)