zmeers / ggparliament

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

Sort parties by ideological position #42

Closed lwarode closed 3 years ago

lwarode commented 5 years ago

Dear all,

is it possible to create a plot which sorts the parliamentary parties by their ideological orientation, e.g. from far left to far right. This should be an important issue, because this type of parliamentary visualization is very common in Political Science and journalism.

Thanks in advance!

zmeers commented 5 years ago

Hi!

Yes, you can sort the plot by parties. The easiest way to do this is to arrange your data before you expand the data via parliament_data(). The order of the data frame is how the data will plot. Say the first row is the Republican Party, the second row is for Democrats and the third row is for Independents. The resulting graph will plot the Republicans first on the left hand side, then Democrats, then Independents.

If you want to plot ideological scores in Euclidean space, like NOMINAATE or ideal point estimates, you can use standard ggplot2 plots, or other R libraries like wnominate, pscl and so on.

Hope that helps. Zoe