add R script and tidy data