add R file for plotting