generated required R scripts and png file