Description Usage Arguments Value Author(s) Examples
View source: R/create.stacked.barplot.R
Create a barplot with a fill variable to show a stacked barplot.
1 |
filename |
Name of file to write plot to, if NULL is provided the plots displays to STDOUT (default: NULL) |
x |
The value for the x-axis (required) |
fill |
The value to fill the bars (required) |
data |
The dataframe containing the data for the plot (required) |
rotate |
A boolean variable to rotate the barplot (default: FALSE) |
width |
Defines the width of the bars (default: 0.9) |
xlab |
The label for the x-axis (default: NULL) |
ylab |
The label for the y-axis (default: NULL) |
xaxis.log.scale |
BOOLEAN to set xaxis to log scale (default: FALSE) |
yaxis.log.scale |
BOOLEAN to set yaxis to log scale (default: FALSE) |
show.legend |
A boolean to determine whether to show or hide the legend (default: TRUE) |
group.by |
Dataframe element to use in facet_grid() to group bars (default: NULL) |
group |
Group by 'row' or 'col', (default: row) |
theme |
Theme function for plot (default: NULL) |
resolution |
Resolution of plot (default: 900) |
Returns a ggplot object.
Richard de Borja <richard.deborja@sickkids.ca>
1 | create.stacked.barplot(data = diamonds, x = 'clarity', width = 0.9, fill = 'cut', xlab = 'Diamond Clarity', ylab = 'Count', show.legend = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.