reusable code written in R