{"id":8323,"date":"2018-12-31T08:46:30","date_gmt":"2018-12-31T06:46:30","guid":{"rendered":"https:\/\/www.datanovia.com\/en\/?post_type=dt_lessons&#038;p=8323"},"modified":"2019-11-17T23:52:53","modified_gmt":"2019-11-17T21:52:53","slug":"ggplot-error-bars","status":"publish","type":"dt_lessons","link":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/","title":{"rendered":"GGPlot Error Bars"},"content":{"rendered":"<div id=\"rdoc\">\n<p><strong>Error Bars<\/strong> are used to visualize the variability of the plotted data. Error Bars can be applied to graphs such as, Dot Plots, Barplots or Line Graphs, to provide an additional layer of detail on the presented data.<\/p>\n<p>Generally, Error bars are used to show either the standard deviation, standard error, confidence intervals or interquartile range.<\/p>\n<p>The length of an Error Bar helps reveal the uncertainty of a data point: a short Error Bar shows that values are concentrated, signalling that the plotted average value is more likely, while a long Error Bar would indicate that the values are more spread out and less reliable.<\/p>\n<p>This article describes how to add error bars into a plot using the <strong>ggplot2<\/strong> R package. You will learn how to create bar plots and line plots with error bars<\/p>\n<p>Contents:<\/p>\n<div id=\"TOC\">\n<ul>\n<li><a href=\"#loading-required-r-package\">Loading required R package<\/a><\/li>\n<li><a href=\"#data-preparation\">Data preparation<\/a><\/li>\n<li><a href=\"#key-r-functions-and-error-plot-types\">Key R functions and error plot types<\/a><\/li>\n<li><a href=\"#basic-error-bars\">Basic error bars<\/a><\/li>\n<li><a href=\"#grouped-error-bars\">Grouped error bars<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<\/div>\n<div class='dt-sc-hr-invisible-medium  '><\/div>\n<div class='dt-sc-ico-content type1'><div class='custom-icon' ><a href='https:\/\/www.datanovia.com\/en\/product\/ggplot2-essentials-for-great-data-visualization-in-r\/' target='_blank'><span class='fa fa-book'><\/span><\/a><\/div><h4><a href='https:\/\/www.datanovia.com\/en\/product\/ggplot2-essentials-for-great-data-visualization-in-r\/' target='_blank'> Related Book <\/a><\/h4>GGPlot2 Essentials for Great Data Visualization in R<\/div>\n<div class='dt-sc-hr-invisible-medium  '><\/div>\n<div id=\"loading-required-r-package\" class=\"section level2\">\n<h2>Loading required R package<\/h2>\n<p>Load the ggplot2 package and set the default theme to <code>theme_classic()<\/code> with the legend at the top of the plot:<\/p>\n<pre class=\"r\"><code>library(ggplot2)\r\ntheme_set(\r\n  theme_classic() +\r\n    theme(legend.position = \"top\")\r\n  )<\/code><\/pre>\n<\/div>\n<div id=\"data-preparation\" class=\"section level2\">\n<h2>Data preparation<\/h2>\n<ul>\n<li>Prepare the data: <code>ToothGrowth<\/code> data set.<\/li>\n<\/ul>\n<pre class=\"r\"><code>df &lt;- ToothGrowth\r\ndf$dose &lt;- as.factor(df$dose)\r\nhead(df, 3)<\/code><\/pre>\n<pre><code>##    len supp dose\r\n## 1  4.2   VC  0.5\r\n## 2 11.5   VC  0.5\r\n## 3  7.3   VC  0.5<\/code><\/pre>\n<ul>\n<li>Compute summary statistics for the variable <code>len<\/code> organized into groups by the variable <code>dose<\/code>:<\/li>\n<\/ul>\n<pre class=\"r\"><code>library(dplyr)\r\ndf.summary &lt;- df %&gt;%\r\n  group_by(dose) %&gt;%\r\n  summarise(\r\n    sd = sd(len, na.rm = TRUE),\r\n    len = mean(len)\r\n  )\r\ndf.summary<\/code><\/pre>\n<pre><code>## # A tibble: 3 x 3\r\n##   dose     sd   len\r\n##   &lt;fct&gt; &lt;dbl&gt; &lt;dbl&gt;\r\n## 1 0.5    4.50  10.6\r\n## 2 1      4.42  19.7\r\n## 3 2      3.77  26.1<\/code><\/pre>\n<\/div>\n<div id=\"key-r-functions-and-error-plot-types\" class=\"section level2\">\n<h2>Key R functions and error plot types<\/h2>\n<p>Key functions to create error plots using the summary statistics data:<\/p>\n<ul>\n<li><code>geom_crossbar()<\/code> for hollow bar with middle indicated by horizontal line<\/li>\n<li><code>geom_errorbar()<\/code> for error bars<\/li>\n<li><code>geom_errorbarh()<\/code> for horizontal error bars<\/li>\n<li><code>geom_linerange()<\/code> for drawing an interval represented by a vertical line<\/li>\n<li><code>geom_pointrange()<\/code> for creating an interval represented by a vertical line, with a point in the middle.<\/li>\n<\/ul>\n<p>Start by initializing ggplot with the summary statistics data:<\/p>\n<ul>\n<li>Specify x and y as usually<\/li>\n<li>Specify <code>ymin = len-sd<\/code> and <code>ymax = len+sd<\/code> to add lower and upper error bars. If you want only to add upper error bars but not the lower ones, use <code>ymin = len<\/code> (instead of <code>len-sd<\/code>) and <code>ymax = len+sd<\/code>.<\/li>\n<\/ul>\n<pre class=\"r\"><code># Initialize ggplot with data\r\nf &lt;- ggplot(\r\n  df.summary, \r\n  aes(x = dose, y = len, ymin = len-sd, ymax = len+sd)\r\n  )<\/code><\/pre>\n<p>Possible error plots:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-ggplot2-graphics-error-bars-1.png\" width=\"153.6\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-ggplot2-graphics-error-bars-2.png\" width=\"153.6\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-ggplot2-graphics-error-bars-3.png\" width=\"153.6\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-ggplot2-graphics-error-bars-4.png\" width=\"153.6\" \/><\/p>\n<\/div>\n<div id=\"basic-error-bars\" class=\"section level2\">\n<h2>Basic error bars<\/h2>\n<p>Create simple error plots:<\/p>\n<pre class=\"r\"><code># Vertical line with point in the middle\r\nf + geom_pointrange()\r\n\r\n# Standard error bars\r\nf + geom_errorbar(width = 0.2) +\r\n  geom_point(size = 1.5)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-error-bars-1.png\" width=\"240\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-error-bars-2.png\" width=\"240\" \/><\/p>\n<p>Create horizontal error bars. Put <code>dose<\/code> on y axis and <code>len<\/code> on x-axis. Specify <code>xmin<\/code> and <code>xmax<\/code>.<\/p>\n<pre class=\"r\"><code># Horizontal error bars with mean points\r\n# Change the color by groups\r\nggplot(df.summary, aes(x = len, y = dose, xmin = len-sd, xmax = len+sd)) +\r\n  geom_point() +\r\n  geom_errorbarh(height=.2)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-ggplot2_errorbarh-horizontal-error-bars-1.png\" width=\"336\" \/><\/p>\n<ul>\n<li>Add jitter points (representing individual points), dot plots and violin plots. For this, you should initialize ggplot with original data (<code>df<\/code>) and specify the <code>df.summary<\/code> data in the error plot function, here <code>geom_pointrange()<\/code>.<\/li>\n<\/ul>\n<pre class=\"r\"><code># Combine with jitter points\r\nggplot(df, aes(dose, len)) +\r\n  geom_jitter(position = position_jitter(0.2), color = \"darkgray\") + \r\n  geom_pointrange(aes(ymin = len-sd, ymax = len+sd),data = df.summary)\r\n\r\n# Combine with violin plots\r\nggplot(df, aes(dose, len)) +\r\n  geom_violin(color = \"darkgray\", trim = FALSE) + \r\n  geom_pointrange(aes(ymin = len-sd, ymax = len+sd), data = df.summary)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-error-bars-with-jitter-points-dot-plots-violin-plots-1.png\" width=\"288\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-error-bars-with-jitter-points-dot-plots-violin-plots-2.png\" width=\"288\" \/><\/p>\n<ul>\n<li>Create basic bar\/line plots of mean +\/- error. So we need only the <code>df.summary<\/code> data. :\n<ol style=\"list-style-type: decimal;\">\n<li>Add lower and upper error bars for the line plot: <code>ymin = len-sd<\/code> and <code>ymax = len+sd<\/code>.<\/li>\n<li>Add only upper error bars for the bar plot: <code>ymin = len<\/code> (instead of <code>len-sd<\/code>) and <code>ymax = len+sd<\/code>.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<div class=\"warning\">\n<p>Note that, for line plot, you should always specify <code>group = 1<\/code> in the <code>aes()<\/code>, when you have one group of line.<\/p>\n<\/div>\n<pre class=\"r\"><code># (1) Line plot\r\nggplot(df.summary, aes(dose, len)) +\r\n  geom_line(aes(group = 1)) +\r\n  geom_errorbar( aes(ymin = len-sd, ymax = len+sd),width = 0.2) +\r\n  geom_point(size = 2)\r\n\r\n# (2) Bar plot\r\nggplot(df.summary, aes(dose, len)) +\r\n  geom_col(fill = \"lightgray\", color = \"black\") +\r\n  geom_errorbar(aes(ymin = len, ymax = len+sd), width = 0.2) <\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-bar-plot-and-line-plot-1.png\" width=\"288\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-bar-plot-and-line-plot-2.png\" width=\"288\" \/><\/p>\n<p>For line plot, you might want to treat x-axis as numeric:<\/p>\n<pre class=\"r\"><code>df.sum2 &lt;- df.summary\r\ndf.sum2$dose &lt;- as.numeric(df.sum2$dose)\r\nggplot(df.sum2, aes(dose, len)) +\r\n  geom_line() +\r\n  geom_errorbar( aes(ymin = len-sd, ymax = len+sd),width = 0.2) +\r\n  geom_point(size = 2)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-line-plot-with-numeric-x-axis-1.png\" width=\"288\" \/><\/p>\n<ul>\n<li>Bar plots and line plots + jitter points. We need the original <code>df<\/code> data for the jitter points and the <code>df.summary<\/code> data for the other <code>geom<\/code> layers.\n<ol style=\"list-style-type: decimal;\">\n<li>For the line plot: First, add jitter points, then add lines + error bars + mean points on top of the jitter points.<\/li>\n<li>For the bar plot: First, add the bar plot, then add jitter points + error bars on top of the bars.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<pre class=\"r\"><code># (1) Create a line plot of means + \r\n# individual jitter points + error bars \r\nggplot(df, aes(dose, len)) +\r\n  geom_jitter( position = position_jitter(0.2), color = \"darkgray\") + \r\n  geom_line(aes(group = 1), data = df.summary) +\r\n  geom_errorbar(\r\n    aes(ymin = len-sd, ymax = len+sd),\r\n    data = df.summary, width = 0.2) +\r\n  geom_point(data = df.summary, size = 2)\r\n\r\n# (2) Bar plots of means + individual jitter points + errors\r\nggplot(df, aes(dose, len)) +\r\n  geom_col(data = df.summary, fill = NA, color = \"black\") +\r\n  geom_jitter( position = position_jitter(0.2), color = \"black\") + \r\n  geom_errorbar( aes(ymin = len-sd, ymax = len+sd), \r\n                 data = df.summary, width = 0.2) <\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-line-plot-with-error-bars-1.png\" width=\"316.8\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-line-plot-with-error-bars-2.png\" width=\"316.8\" \/><\/p>\n<\/div>\n<div id=\"grouped-error-bars\" class=\"section level2\">\n<h2>Grouped error bars<\/h2>\n<p>Case of one continuous variable (<code>len<\/code>) and two grouping variables (<code>dose<\/code>, <code>supp<\/code>).<\/p>\n<ul>\n<li>Compute the summary statistics of <code>len<\/code> grouped by <code>dose<\/code> and <code>supp<\/code>:<\/li>\n<\/ul>\n<pre class=\"r\"><code>library(dplyr)\r\ndf.summary2 &lt;- df %&gt;%\r\n  group_by(dose, supp) %&gt;%\r\n  summarise(\r\n    sd = sd(len),\r\n    len = mean(len)\r\n  )\r\ndf.summary2<\/code><\/pre>\n<pre><code>## # A tibble: 6 x 4\r\n## # Groups:   dose [?]\r\n##   dose  supp     sd   len\r\n##   &lt;fct&gt; &lt;fct&gt; &lt;dbl&gt; &lt;dbl&gt;\r\n## 1 0.5   OJ     4.46 13.2 \r\n## 2 0.5   VC     2.75  7.98\r\n## 3 1     OJ     3.91 22.7 \r\n## 4 1     VC     2.52 16.8 \r\n## 5 2     OJ     2.66 26.1 \r\n## 6 2     VC     4.80 26.1<\/code><\/pre>\n<ul>\n<li>Create error plots for multiple groups:\n<ol style=\"list-style-type: decimal;\">\n<li>pointrange colored by groups (supp)<\/li>\n<li>standard error bars + mean points colored by groups (supp)<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<pre class=\"r\"><code># (1) Pointrange: Vertical line with point in the middle\r\nggplot(df.summary2, aes(dose, len)) +\r\n  geom_pointrange(\r\n    aes(ymin = len-sd, ymax = len+sd, color = supp),\r\n    position = position_dodge(0.3)\r\n    )+\r\n  scale_color_manual(values = c(\"#00AFBB\", \"#E7B800\"))\r\n\r\n\r\n# (2) Standard error bars\r\nggplot(df.summary2, aes(dose, len)) +\r\n  geom_errorbar(\r\n    aes(ymin = len-sd, ymax = len+sd, color = supp),\r\n    position = position_dodge(0.3), width = 0.2\r\n    )+\r\n  geom_point(aes(color = supp), position = position_dodge(0.3)) +\r\n  scale_color_manual(values = c(\"#00AFBB\", \"#E7B800\")) <\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-error-plot-for-multiple-groups-geom_pointrange-and-geom_errorbar-1.png\" width=\"336\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-error-plot-for-multiple-groups-geom_pointrange-and-geom_errorbar-2.png\" width=\"336\" \/><\/p>\n<ul>\n<li>Create simple line\/bar plots for multiple groups.\n<ol style=\"list-style-type: decimal;\">\n<li>Line plots: change linetype by groups (<code>supp<\/code>)<\/li>\n<li>Bar plots: change fill color by groups (<code>supp<\/code>)<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<pre class=\"r\"><code># (1) Line plot + error bars\r\nggplot(df.summary2, aes(dose, len)) +\r\n  geom_line(aes(linetype = supp, group = supp))+\r\n  geom_point()+\r\n  geom_errorbar(\r\n    aes(ymin = len-sd, ymax = len+sd, group = supp),\r\n     width = 0.2\r\n    )\r\n\r\n# (2) Bar plots + upper error bars.\r\nggplot(df.summary2, aes(dose, len)) +\r\n  geom_col(aes(fill = supp), position = position_dodge(0.8), width = 0.7)+\r\n  geom_errorbar(\r\n    aes(ymin = len, ymax = len+sd, group = supp),\r\n    width = 0.2, position = position_dodge(0.8)\r\n    )+\r\n  scale_fill_manual(values = c(\"grey80\", \"grey30\"))<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-line-plot-and-bar-plot-for-multiple-groups-1.png\" width=\"336\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-line-plot-and-bar-plot-for-multiple-groups-2.png\" width=\"336\" \/><\/p>\n<ul>\n<li>Add jitter points:<\/li>\n<\/ul>\n<pre class=\"r\"><code># Line plots with jittered points\r\nggplot(df, aes(dose, len, color = supp)) +\r\n  geom_jitter(position = position_jitter(0.2)) + \r\n  geom_line(aes(group = supp),data = df.summary2) +\r\n  geom_errorbar(aes(ymin = len-sd, ymax = len+sd), data = df.summary2, width = 0.2)+\r\n  scale_color_manual(values = c(\"#00AFBB\", \"#E7B800\")) +\r\n  theme(legend.position = \"top\")\r\n\r\n# Bar plots + jittered points + error bars\r\nggplot(df, aes(dose, len, color = supp)) +\r\n  geom_col(data = df.summary2, position = position_dodge(0.8), \r\n           width = 0.7, fill = \"white\") +\r\n  geom_jitter(\r\n    position = position_jitterdodge(jitter.width = 0.2, dodge.width = 0.8)\r\n    ) + \r\n  geom_errorbar(\r\n    aes(ymin = len-sd, ymax = len+sd), data = df.summary2, \r\n    width = 0.2, position = position_dodge(0.8)\r\n    )+\r\n  scale_color_manual(values = c(\"#00AFBB\", \"#E7B800\")) +\r\n  theme(legend.position = \"top\")<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-grouped-line-plots-and-bar-plots-with-points-1.png\" width=\"336\" \/><img decoding=\"async\" src=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/dn-tutorials\/ggplot2\/figures\/011-ggplot-error-bars-grouped-line-plots-and-bar-plots-with-points-2.png\" width=\"336\" \/><\/p>\n<\/div>\n<div id=\"conclusion\" class=\"section level2\">\n<h2>Conclusion<\/h2>\n<p>This article describes how to add error bars to plots created using the ggplot2 R package.<\/p>\n<\/div>\n<\/div>\n<p><!--end rdoc--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Error Bars are used to visualize the variability of the plotted data. Error Bars can be applied to graphs such as, Dot Plots, Barplots or Line Graphs, to provide an additional layer of detail on the presented data. Generally, Error bars are used to show either the standard deviation, standard error, confidence intervals or interquartile range. The length of an Error Bar helps reveal the uncertainty of a data point. This article describes how to add error bars into a plot using the ggplot2 R package. You will learn how to create bar plots and line plots with error bars<\/p>\n","protected":false},"author":1,"featured_media":7938,"parent":0,"menu_order":16,"comment_status":"open","ping_status":"closed","template":"","class_list":["post-8323","dt_lessons","type-dt_lessons","status-publish","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GGPlot Error Bars Best Reference - Datanovia<\/title>\n<meta name=\"description\" content=\"This article describes how to add error bars into a plot using the ggplot2 R package. You will learn how to create bar plots and line plots with error bars\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GGPlot Error Bars Best Reference - Datanovia\" \/>\n<meta property=\"og:description\" content=\"This article describes how to add error bars into a plot using the ggplot2 R package. You will learn how to create bar plots and line plots with error bars\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/\" \/>\n<meta property=\"og:site_name\" content=\"Datanovia\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-17T21:52:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/\",\"name\":\"GGPlot Error Bars Best Reference - Datanovia\",\"isPartOf\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg\",\"datePublished\":\"2018-12-31T06:46:30+00:00\",\"dateModified\":\"2019-11-17T21:52:53+00:00\",\"description\":\"This article describes how to add error bars into a plot using the ggplot2 R package. You will learn how to create bar plots and line plots with error bars\",\"breadcrumb\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#primaryimage\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg\",\"width\":1024,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.datanovia.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lessons\",\"item\":\"https:\/\/www.datanovia.com\/en\/lessons\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"GGPlot Error Bars\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#website\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"name\":\"Datanovia\",\"description\":\"Data Mining and Statistics for Decision Support\",\"publisher\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.datanovia.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#organization\",\"name\":\"Datanovia\",\"url\":\"https:\/\/www.datanovia.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"contentUrl\":\"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png\",\"width\":98,\"height\":99,\"caption\":\"Datanovia\"},\"image\":{\"@id\":\"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GGPlot Error Bars Best Reference - Datanovia","description":"This article describes how to add error bars into a plot using the ggplot2 R package. You will learn how to create bar plots and line plots with error bars","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/","og_locale":"en_US","og_type":"article","og_title":"GGPlot Error Bars Best Reference - Datanovia","og_description":"This article describes how to add error bars into a plot using the ggplot2 R package. You will learn how to create bar plots and line plots with error bars","og_url":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/","og_site_name":"Datanovia","article_modified_time":"2019-11-17T21:52:53+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/","url":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/","name":"GGPlot Error Bars Best Reference - Datanovia","isPartOf":{"@id":"https:\/\/www.datanovia.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#primaryimage"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg","datePublished":"2018-12-31T06:46:30+00:00","dateModified":"2019-11-17T21:52:53+00:00","description":"This article describes how to add error bars into a plot using the ggplot2 R package. You will learn how to create bar plots and line plots with error bars","breadcrumb":{"@id":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#primaryimage","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/10\/Chemin_du_Pic_de_St_Laurent_de_Muret.jpg","width":1024,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.datanovia.com\/en\/lessons\/ggplot-error-bars\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.datanovia.com\/en\/"},{"@type":"ListItem","position":2,"name":"Lessons","item":"https:\/\/www.datanovia.com\/en\/lessons\/"},{"@type":"ListItem","position":3,"name":"GGPlot Error Bars"}]},{"@type":"WebSite","@id":"https:\/\/www.datanovia.com\/en\/#website","url":"https:\/\/www.datanovia.com\/en\/","name":"Datanovia","description":"Data Mining and Statistics for Decision Support","publisher":{"@id":"https:\/\/www.datanovia.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanovia.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanovia.com\/en\/#organization","name":"Datanovia","url":"https:\/\/www.datanovia.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","contentUrl":"https:\/\/www.datanovia.com\/en\/wp-content\/uploads\/2018\/09\/datanovia-logo.png","width":98,"height":99,"caption":"Datanovia"},"image":{"@id":"https:\/\/www.datanovia.com\/en\/#\/schema\/logo\/image\/"}}]}},"multi-rating":{"mr_rating_results":[]},"_links":{"self":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/8323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons"}],"about":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/types\/dt_lessons"}],"author":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/comments?post=8323"}],"version-history":[{"count":0,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/dt_lessons\/8323\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media\/7938"}],"wp:attachment":[{"href":"https:\/\/www.datanovia.com\/en\/wp-json\/wp\/v2\/media?parent=8323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}