Replaced calls to RSQLite with dplyr
Fixed buildHistogram