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")
data | The original data set. |
---|---|
numerical | The numerical variable which will be visualised in the bar plot. |
factors | One or more factor variables which will be used for grouping.
Use |
size | Choose whether you want more/less than 1 standard deviation/standard error. Defaults to 1. |
type | 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.
D. Schmitz
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