mk_boxplot | R Documentation |
mk_boxplot
takes a data frame as input and returns a function for
making boxplots with any categorical variable from the data frame on the
x-axis and any continuous variable on the y-axis. The output function can
also produce dodged boxplots when supplied a second categorical variable, a
fillby variable.
mk_boxplot(df)
df |
A data frame. |
function(xvar = "1", yvar, fillby = "1", notched = FALSE,
legend_title = fillby, legend_pos = "right",
label_size = 3, font_size = 14)
xvar. String, name of a categorical variable for x-axis. Default = "1", just draw a boxplot of yvar by itself.
yvar. String, name of a continuous variable for y-axis.
fillby. String, name of a different categorical variable for breaking down the y values of each box. Default = "1", meaning no such variable is supplied.
notched. Logical, draw notched boxplots when TRUE; otherwise, draw regular boxplots. Default = FALSE.
legend_title. String, legend title. Default is the name of the fillby variable.
legend_pos. String, legend position. Default = "right".
label_size. Integer, size of bar label text. Default = 3.
font_size. Overall font size. Default = 14. The font size of the axes and legend text is a fraction of this value.
inst/examples/ex-mk_boxplot.R
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.