Creating smart reports and applications with machine learning and R