I've been using a visualisation library called RankinPlot. rankinPlot/grottaBar.R at master · HannahJohns/rankinPlot · GitHub.
It is designed for placing counts and proportions in a stacked horizontal bar plot. Yet, I wondered if someone could please help me with re-organising the order of the barplot?
For instance, in the example below there are two variables in the treatment group: "placebo" and "alteplase". I wondered if it is possible to organise such a graph such that placebo would be placed on top?
Here, I don't know if it possible to re-arrange columns within the table labelled 'x' or if there are alternative methods?
Any help would be greatly appreciated.
devtools::install_github("HannahJohns/rankinPlot") library(rankinPlot) df <- alteplase str(df) df$mRS <- df$mRS -1 x <- table(mRS=df$mRS, Group=df$treat, Time=df$time) Z <- grottaBar(x,groupName="Group", scoreName = "mRS", strataName="Time", colourScheme ="lowGreen" ) Z