I am trying to make a spiral side-by-side bar chart like the following examples:
The previous one is from Spiral barplot using ggplot & coord_polar (Condegram), but I couldn't make it work for my data.
Using ggplot, this is as far as I have gotten:
data <- read.table(text="year group1 group2
1973 25939 27147
1978 21086 23108
1989 28401 24010
1995 34601 25457
2000 38672 28894
2007 40874 34926
2009 43892 38169
2013 48028 39270
2014 47289 39948
2015 48261 41913
2016 49814 42373
2017 50346 42818",header=T)
data$year <- as.character(data$year)
data <- data %>% gather(group, value, group1:group2)
ggplot(data)+
geom_bar(aes(x=year, y=value, fill=group), stat="identity", position = "dodge") +
coord_polar()
Which produces an ugly spiral bar chart
I'm not sure how to make the bottoms square and add the space the white spiral needs. Any help and explanation would be greatly appreciated!