Scripts in R for various types of applications