clean up R scripts for plotting figures