worldbank/dime-r-training

May 2022 - Data Visualization

Closed this issue · 1 comments

  • There is a lot of discussion about where to include the aesthetics (inside ggplot, inside geometries, etc). This is a bit confusing right now. We should mention this in a single place, explain when you want to have it separately or not. Then we should follow a single pattern. For example, when specifying size of geom_scatter, we say that it should not be inside ggplot. But there is no good reason for that (I would actually have it inside the ggplot if we are using a single geom)
  • There is a graph that is creating a latam dummy using piping. We should explain that this does not modify the data, it's only creating a dummy for the purposes of the graph. This is actually not great practice. The piping would be better used to remove NAs, because in this case we do not want to remove observations from the data, only from the graph.

Didn't respond to the issue during last year's update but this was taken into consideration!

  • Aesthetics are consistently included within the geometries now. This is my preferred recommendation as sometimes we need to reuse aesthetics (e.g. color or fill) for separate geometries (using the inherit.aes = FALSE argument), so might as well teach to include aesthetics in the geometries upfront. I can't think of a drawback to doing it this way although happy to learn if there are any!
  • Actually didn't do this next year so changing this this year, removing NAs from data and creating the labam dummy prior to creating the graph itself.