R scripts for summary plots