wrap.bar | R Documentation |
Creates bar plots for numerical dependent variables, adds error bars,
and prints descriptive statistics in a summary table. The function creates plots
for up to 3 factors total, including 0-1 within-subjects factors and 0-3 between-
subjects factors. The function delegates the primary computations to ggplot
.
wrap.bar( dv1, iv1 = NULL, iv2 = NULL, iv3 = NULL, errorbar = "se", ylim = NULL, ymajor = NULL, ylab = NULL, xlab = NULL, title = NULL, size.axis.text.y = 12, size.axis.text.x = 16, size.title = 24, size.panel.title = 12, size.legend.text = 14, reposition = NULL, rename1 = NULL, rename2 = NULL, rename3 = NULL, reorder1 = NULL, reorder2 = NULL, reorder3 = NULL )
dv1 |
Column vector containing the between-subjects dependent variable OR multiple column vectors containing the within-subjects dependent variables |
iv1, iv2, iv3 |
Column vectors containing the independent variables |
errorbar |
Character string specifying the length of the error bars:
|
ylim |
Numeric vector containing lower and upper y-axis limits |
ymajor |
Numeric argument representing spacing of y-axis tick marks |
ylab |
Character string containing the y-axis label |
xlab |
Character string containing the x-axis label |
title |
Character string containing the plot title |
size.axis.text.y, size.axis.text.x, size.title, size.panel.title, size.legend.text |
Numeric arguments containing font sizes |
reposition |
Numeric vector to rearrange columns in the summary table and
thus reposition factors within the plot itself. For example, |
rename1, rename2, rename3 |
String vectors to rename the factor levels in the summary
table and thus rename factor levels within the plot itself. For example,
|
reorder1, reorder2, reorder3 |
String vectors to reorder the factor levels in the
summary table and thus reorder factor levels within the plot itself. For example,
|
ggplot
## Bar plot with 1 within-subjects factor wrap.bar(dv1 = bdata[c(10:12)], ylim=c(0, 10), ymajor=2) ## Bar plot with 2 between-subjects factors wrap.bar(dv1 = bdata$DV5, iv1 = bdata$IV1, iv2 = bdata$IV2, ylim=c(0, 10), ymajor=2) ## Bar plot with 1 within-subjects factor & 2 between-subjects factors wrap.bar(dv1 = bdata[c(10:12)], iv1 = bdata$IV1, iv2 = bdata$IV3, ylim=c(0, 10), ymajor=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.