Working on the msleep
and mpg
datasets in the ggplot2
package, using the plot command
ggplot(msleep%>%filter(!is.na(brainwt)),
mapping=aes(x=bodywt,
y=sleep_total,
shape=vore,
colour=order,
size=brainwt))+
geom_point(na.rm=FALSE)
or otherwise, tidy up the plot to more clearly show the data. Develop other plots that show the data. Compare using colours, shape, and facet_wraps to represent discrete data.
Artificially modify the data to induce patterns to be detected. Try the following modifications:
The first is a constant difference in sleep times based on diet. The second is an interaction between bodyweight and diet.
For the mpg
dataset, try to construct a misleading
plot that gives the impression that Audi cars have better MPG than
other cars.
[Making misleading plots is unethical. This exercise is not to encourage unethical behaviour, but to understand ways in which plots can mislead, or can show particular conclusions.]