Description Usage Arguments See Also Examples
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
.
Error bars are +/-1 SE.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | wrap.bar(
dv1,
iv1 = NULL,
iv2 = NULL,
iv3 = NULL,
reposition = NULL,
rename1 = NULL,
rename2 = NULL,
rename3 = NULL,
reorder1 = NULL,
reorder2 = NULL,
reorder3 = NULL,
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
)
|
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 |
reposition |
Numeric vector to rearrange columns in the summary table and
thus reposition factors within the plot itself. For example, |
rename1, rename2, rename3 |
Character vectors to rename the factor levels in the summary
table and thus rename factor levels within the plot itself. For example,
|
reorder1, reorder2, reorder3 |
Character vectors to reorder the factor levels in the
summary table and thus reorder factor levels within the plot itself. For example,
|
ylim |
Numeric vector containing lower and upper y-axis limits |
ymajor |
Numeric argument representing spacing of y-axis gridlines |
ylab |
String containing the y-axis label |
xlab |
String containing the x-axis label |
title |
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 |
1 2 3 4 5 6 7 8 | ## Bar plot with 1 within-subjects factor
wrap.bar(dv1 = bdata[c(4,6)])
## Bar plot with 2 between-subjects factors
wrap.bar(dv1 = bdata$DV1, iv1 = bdata$IV1, iv2 = bdata$IV2)
## Bar plot with 1 within-subjects factor & 2 between-subjects factors
wrap.bar(dv1 = bdata[c(4,6)], iv1 = bdata$IV1, iv2 = bdata$IV3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.