plot_bars | R Documentation |

Plot % of outcomes as bars

```
plot_bars(
data,
outcome,
proportion,
percentage_labelled,
achieved,
total,
x_axis_title = NULL,
y_axis_title = "% Patients",
legend_title = "Outcome",
bar_fill = "Greys",
grouping = NULL
)
```

`data` |
A data frame containing outcomes data. |

`outcome` |
Variable containing outcomes to be plotted. |

`proportion` |
Variable containing proportion of patients who achieved the outcome. |

`percentage_labelled` |
Variable containing percentage of patients who achieved the outcome, suffixed with '%' label. |

`achieved` |
Variable containing number of patients who achieved the outcome. |

`total` |
Variable containing total number of patients. |

`x_axis_title` |
Title of the x-axis. |

`y_axis_title` |
Title of the y-axis. |

`legend_title` |
Title of the legend. |

`bar_fill` |
Fill color of the bars. |

`grouping` |
Faceting variable. |

A bar plot of outcome percentages.

```
if (FALSE) {
library(phdcocktail)
data(ibd_outcomes, package = "phdcocktail")
plot_bars(ibd_outcomes)
}
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.