R scripts to generate plots