# NOT RUN {
mpg %>%
group_by(manufacturer, class) %>%
summarise(
mean_city_mpg = cog(mean(cty), desc = "Mean city mpg"),
mean_hwy_mpg = cog(mean(hwy), desc = "Mean highway mpg"),
most_common_drv = cog(tail(names(table(drv)), 1), desc = "Most common drive type"),
panel = panel(
figure(xlab = "City mpg", ylab = "Highway mpg",
xlim = c(9, 47), ylim = c(7, 37)) %>%
ly_points(cty, hwy,
hover = data_frame(model = paste(year, model),
cty = cty, hwy = hwy)))) %>%
trelliscope(name = "city_vs_highway_mpg", nrow = 1, ncol = 2)
# }
Run the code above in your browser using DataLab