Connected to db with RMySQL. Working on figuring out a SQL GROUP BY and a chart