data wrangling and presentation in R