Easy Error Bars with R and Plotly

Error bars are a great way to visually represent variability of a dataset, and are easy to graph with Plotly and R! Error bars can be used to visualize standard deviations, standard errors or confidence intervals (just don’t forget to specify which measure the error bar in the graph represents).

Below are two examples that demonstrate how to graph a variety of error bars. The complete R script and data used to create these 2 graphs are available here!

To create vertical error bars, like on the Snow line in the graph below, set

1

error_y=list(type="data",array=c(YOUR_VALUES))

It is also possible to calculate and plot error bars with a percent value, like on the Rain line below. Set: