new r codes for plots and png