zmeers / ggparliament

Simple parliament plots using ggplot2
https://zmeers.github.io/ggparliament/
Other
151 stars 14 forks source link

New geoms #12

Closed zmeers closed 6 years ago

zmeers commented 6 years ago

Ugh, sorry, this file should be (finally!) ready to merge. There's an issue with git on my computer so I'm not pushing from the local version which is causing issues. Take a look at parliament_data.R in the R folder. That file uses ggproto to create new geoms, including the highlighting geom. It also contains a parliament_data() function which transforms aggregate election results in election_results.Rda into something that can be plotted using the new geoms.

RobWHickman commented 6 years ago

changelist before pull:

only really changed parliament_data:

I'm not convinced geom_parliament_waffle() and combine_opposingbenches()** are super necessary but left them in for now

Elsewise looks good. I couldn't seem to get goodpractice to work properly. The only thing it flagged were the dates in the DESCRIPTION etc. but I know theres a separate branch for that so decided against changing it.

*think this .R file might be unecessary/badly named, but I do like having unexported files for small internal functions to clean up the actually important functions

**think this can be done in parliament_data but not sure the best way to incorporate arranging parties by 'real-world' features like if a party is in government. I'm not at all convinced by the method I used (1 vs. NA) but not sure a better way that also lends itself to complicated (e.g. faceted plots)