R sql, basic plot