Created two functions
R script for project