create_error_bar_df.Rd
Create a dataframe with which a ggplot2
bar plot with error bars (+/- 1 standard deviation) can be created.
create_error_bar_df(data, numerical, factors, size = 1, type = "sd")
The original data set.
The numerical variable which will be visualised in the bar plot.
One or more factor variables which will be used for grouping.
Use c("var1", "var2")
for multiple grouping variables.
Choose whether you want more/less than 1 standard deviation/standard error. Defaults to 1.
Choose between "sd" (standard deviation) and "std" (standard error). Defaults to "sd".
A dataframe object.
Wickham, H. (2016) ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York.
data("data_s")
create_error_bar_df(data = data_s, numerical = "sDur", factors = "pauseBin", size = 1, type = "sd")
#> pauseBin sDur sd
#> 1 no_pause 0.1095498 0.03404740
#> 2 pause 0.1654329 0.06289761