Split script into respective functions and build package using Rstudio and roxygen2