update r code for analyzing packages