Lesson Archives

  1. This article describes how to combine multiple ggplots into a figure. You will learn how to use: 1) ggplot2 facet functions for creating multiple panel figures that share the same axes; 2) ggarrange() functiong [ggpubr package] for combining independent ggplots.
  2. ECDF (or Empirical cumulative distribution function) provides an alternative visualization of distribution. It reports for any given number the percent of individuals that are below that threshold. This article describes how to create an ECDF in R using the function stat_ecdf() in ggplot2 package.
  3. A Quantile-quantile plot (or QQPlot) is used to check whether a given data follows normal distribution. The data is assumed to be normally distributed when the points approximately follow the 45-degree reference (diagonal) line. This article describes how to create a qqplot in R using the ggplot2 package.
  4. A histogram plot is an alternative to Density plot for visualizing the distribution of a continuous variable. This chart represents the distribution of a continuous variable by dividing into bins and counting the number of observations in each bin. This article describes how to create Histogram plots using the ggplot2 R package.
  5. A density plot is an alternative to Histogram used for visualizing the distribution of a continuous variable. The peaks of a Density Plot help to identify where values are concentrated over the interval of the continuous variable. Compared to Histograms, Density Plots are better at finding the distribution shape because they are re not affected by the number of bins used (each bar used in a typical histogram). This article describes how to create density plots using the ggplot2 R package.
  6. 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
  7. Barplot is used to show discrete, numerical comparisons across categories. One axis of the chart shows the specific categories being compared and the other axis represents a discrete value scale.This article describes how to create a barplot using the ggplot2 R package.You will learn how to: 1) Create basic and grouped barplots; 2) Add labels to a barplot; 3) Change the bar line and fill colors by group
  8. In a line plot, observations are ordered by x value and connected by a line. This article describes how to create a line plot using the ggplot2 R package. You will learn how to: 1) Create basic and grouped line plots; 2) Add points to a line plot; 3) Change the line types and colors by group.