Rscripts for various tasks