added compact fxn to avoid importing from plyr, replaced jsonlite fromjson calls with rjsoniio