## How to Add Regression Line Equation and R-Squared on Graph using R

This tutorial will go through adding the regression line equation and R-squared to a plot in R with code examples. Table of contentsWhat is the Regression Equation?What is the R-Squared Value?Example: Using ggpubrCreate DataPlot Data and Add Regression EquationPlot...

## How to Solve R Error in rep(1, n) : invalid “times” argument

This error occurs when you call the rep function to replicate data, but the value you provide to replicate the number is not a positive real number. You can solve this problem by ensuring that the number is a single, positive real number. This tutorial will go through...

## How to Solve R Error: Could not find function “%”

The pipe operator, %>%, is a special function available under the magrittr package that allows you to pass the result of one function/argument to the other one in sequence. To use the pipe operator, you need to install and load the magrittr package....

## How to Remove Outliers from Boxplot using ggplot2 in R

This tutorial will go through how to remove outliers from a boxplot using ggplot2 in R with the help of code examples. Table of contentsExampleRemove Outlier Using outlier.shape=NASummary Example In the following example, we are going to use the iris dataset to create...

## How to Place Two Plots Side by Side using ggplot2 and cowplot in R

The easiest way to place two plots side by side using ggplot2 is to install gridExtra and then use the grid.arrange() function. For example, install.packages(“gridExtra”) grid.arrange(plot1, plot2, ncol=2) This tutorial will go through how to place two...