parse_packages function

Parse R code for required packages