View source: R/create_error_bar_df.R
| create_error_bar_df | R Documentation |
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.
D. Schmitz
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.