# R Programming Language (Analysis Software for Statistics & Data Science)

R is a programming language and software that is becoming increasingly popular in the disciplines of statistics and data science.

R is a dialect of the S programming language and was developed by Ross Ihaka and Robert Gentleman in the year 1995. A stable beta version was released in the year 2000.

The R software is completely free and gets developed collaboratively by its community (open source software) – every R user can publish new add-on packages.

The open source ideology of R programming reflects a huge contrast compared to most traditional programming environments (e.g. SAS, SPSS, Stata etc.), where the software development is in the hands of a payed development team.

## All R Tutorials on statisticsglobe.com

In the following, you can find a list of R tutorials on statisticsglobe.com. In the tutorials, I’m explaining statistical concepts and provide reproducible example codes in R.

### abline Function in R (6 Examples)

abline Function in R (6 Examples)   In this tutorial, I'll illustrate how to draw lines to plots using the abline function in R programming . The article consists of the following information: So without further ado, let's dive...

### Access Index Names of List Using lapply Function in R (Example)

Access Index Names of List Using lapply Function in R (Example)   This post explains how to work with list indices within the FUN argument of the lapply function in R . The article will contain one example for the application of the lapply...

### Add & Subtract Days to & from Date in R (2 Examples)

Add & Subtract Days to & from Date in R (2 Examples)   In this tutorial, I'll explain how to add or subtract a certain number of days from a date object in the R programming language . The article looks as follows: You're here for...

### Add & Subtract Months & Years to/from Date Object in R (2 Examples)

Add & Subtract Months & Years to/from Date Object in R (2 Examples)   In this tutorial you'll learn how to add and subtract months or years from a Date object in the R programming language . Table of contents: With that, let's get...

### Add Axes to Plot Using axis Function in R (4 Examples)

Add Axes to Plot Using axis Function in R (4 Examples)   In this tutorial, I'll show how to create user-defined axis ticks using the axis() function in the R programming language . The tutorial contains the following information: Let's...

### Add Bold & Italic Text to ggplot2 Plot in R (4 Examples)

Add Bold & Italic Text to ggplot2 Plot in R (4 Examples)   In this tutorial you'll learn how to bold and italic text elements to a ggplot2 graph in the R programming language . The content of the article looks as follows: It's time...

### Add Color Between Two Points of Kernel Density Plot in R (Example)

Add Color Between Two Points of Kernel Density Plot in R (Example)   In this tutorial, I'll show how to add color to a certain area below a density plot in the R programming language . The content of the post looks as follows: Introducing...

### Add Common Legend to Combined ggplot2 Plots in R (Example)

Add Common Legend to Combined ggplot2 Plots in R (Example)   In this article, I'll illustrate how to create a shared legend for multiple ggplot2 graphics in the R programming language . Table of contents: Example Data Example:...

### Add Confidence Band to ggplot2 Plot in R (Example)

Add Confidence Band to ggplot2 Plot in R (Example)   In this tutorial you'll learn how to draw a band of confidence intervals to a ggplot2 graphic in R . The content of the page is structured as follows: Let's just jump right in:   Example...

### Add Count & Percentage Labels on Top of Histogram Bars in R (2 Examples)

Add Count & Percentage Labels on Top of Histogram Bars in R (2 Examples)   This article shows how to draw frequencies and percentage points above each bar of a histogram in R . Table of contents: Sound good? Let's get started.   Creation...

### Add Count Labels on Top of ggplot2 Barchart in R (Example)

Add Count Labels on Top of ggplot2 Barchart in R (Example)   In this tutorial you'll learn how to add the frequency count on the top of each bar of a ggplot2 barchart in R . Table of contents: If you want to learn more about these...

### Add Greek Symbols to ggplot2 Plot in R (2 Examples)

Add Greek Symbols to ggplot2 Plot in R (2 Examples)   In this tutorial you'll learn how to create ggplot2 plots with Greek symbols in the R programming language . The content of the article looks as follows: Introduction of Example...

### Add Header to Data Frame in R (Example)

Add Header to Data Frame in R (Example)   In this article, I'll explain how to read a data set without header and adjust the column names in R programming . The post is structured as follows: Let's start right away.   Introducing...

### Add Image to Plot in R (Example) | Draw Picture on Top of Graph Using ggplot2 & patchwork Packages

Add Image to Plot in R (Example) | Draw Picture on Top of Graph Using ggplot2 & patchwork Packages   In this tutorial, I'll show how to add a picture on top of a ggplot2 plot in the R programming language . The article consists of this...

### Add Index ID to Data Frame in R (3 Examples)

Add Index ID to Data Frame in R (3 Examples)   In this article you'll learn how to append an index ID to a data frame in R . The article will consist of the following content: So without further additions, let's jump right to the...

### Add Individual Text to Each Facet of ggplot2 Plot in R (Example)

Add Individual Text to Each Facet of ggplot2 Plot in R (Example)   In this tutorial you'll learn how to annotate different text elements to each facet of a ggplot2 facet graph in the R programming language . The tutorial will contain one...

### Add Inset on Top of Previous Plot Using inset_element Function in R (Example)

Add Inset on Top of Previous Plot Using inset_element Function in R (Example)   On this page, I'll show how to apply the inset_element function to add a plot on top of another plot in the R programming language . The tutorial will consist...

### Add Key Value Pair to List in R (2 Examples)

Add Key Value Pair to List in R (2 Examples)   This article explains how to append a key/value pair to a list object in R programming . Table of contents: Let's take a look at some R codes in action:   Example Data First,...

### Add Label to Straight Line in ggplot2 Plot in R (2 Examples)

Add Label to Straight Line in ggplot2 Plot in R (2 Examples)   In this article you'll learn how to add a labeled line to a ggplot2 graphic in R programming . The post contains the following contents: Let's dive into it.   Example...

### Add Labels at Ends of Lines in ggplot2 Line Plot in R (Example)

Add Labels at Ends of Lines in ggplot2 Line Plot in R (Example)   In this tutorial you'll learn how to draw a ggplot2 line graph with labels at the end of each line in the R programming language . The tutorial contains these content blocks: So...

### Add Leading Zeros in R (Example)

Add Leading Zeros in R (Example)   This article shows how to add leading zeros to a vector in the R programming language . Below, you can find a reproducible R code. The R code is structured as follows: Creation of Example Data ...

### Add Legend to Plot in Base R (8 Examples)

Add Legend to Plot in Base R (8 Examples)   In this article, I'll show how to add a legend to a plot using the legend() function in the R programming language . Table of contents: Let's just jump right in!   Example Data...

### Add Legend without Border & White Background to Plot in R (Example)

Add Legend without Border & White Background to Plot in R (Example)   In this tutorial, I'll explain how to add a legend with white border and background to a graph in R . The page contains the following content blocks: So let's...

### Add Marginal Plot to ggplot2 Scatterplot Using ggExtra Package in R (5 Examples)

Add Marginal Plot to ggplot2 Scatterplot Using ggExtra Package in R (5 Examples)   This article illustrates how to draw a graphic with marginal plot using the ggplot2 and ggExtra packages in the R programming language . The content of...

### Add Mean & Median to Histogram in R (4 Examples)

Add Mean & Median to Histogram in R (4 Examples)   In this tutorial you'll learn how to draw a mean or median line to a histogram in R programming . The content of the page looks as follows: You're here for the answer, so let's...

### Add Multiple New Columns to data.table in R (Example)

Add Multiple New Columns to data.table in R (Example)   On this page you'll learn how to append several new data.table variables in the R programming language . Table of contents: So let's dig in.   Example Data & Packages...

### Add New Column to Data Frame in R

Add New Column to Data Frame in R   In this tutorial, I'll illustrate how to add a new column to a data frame in R programming . The table of content looks like this: Creation of Example Data Example 1: Add Column with \$-Operator...

### Add New Line to Text File in R (Example)

Add New Line to Text File in R (Example)   In this post, I'll show how to append a new line to an already existing TXT file in the R programming language . Table of contents: Let's get started...   Constructing Example...

### Add New Row at Specific Index Position to Data Frame in R (Example)

Add New Row at Specific Index Position to Data Frame in R (Example)   This tutorial shows how to insert a new data frame row at a certain row index in the R programming language . The post is structured as follows: Sound good? Here's...

### Add New Row to Data Frame in R (2 Examples)

Add New Row to Data Frame in R (2 Examples)   In this article you'll learn how to append a new row to a data frame in the R programming language . The table of content looks as follows: Creation of Example Data Example 1: Add Row...

### Add New Variable to Data Frame Based On Other Columns in R (2 Examples)

Add New Variable to Data Frame Based On Other Columns in R (2 Examples)   This tutorial illustrates how to create a new variable based on existing columns of a data frame in R . The post looks as follows: Here's the step-by-step...

### Add Panel Border to ggplot2 Plot in R (Example)

Add Panel Border to ggplot2 Plot in R (Example)   In this article you'll learn how to draw a panel border to a ggplot graphic in the R programming language . Table of contents: Let's dive into it!   Example Data, Add-On...

### Add Prefix to Column Names in R (Example)

Add Prefix to Column Names in R (Example)   In this R programming article you'll learn how to insert a prefix in front of the column names of a data frame . Table of contents: Let's dive right into the example!   Creation...

### Add Regression Line to ggplot2 Plot in R (Example) | Draw Linear Slope to Scatterplot

Add Regression Line to ggplot2 Plot in R (Example) | Draw Linear Slope to Scatterplot   In this R tutorial you'll learn how to add regression lines on scatterplots . The article contains one examples for the addition of a regression slope....

### Add Row to Empty Data Frame in R (Example)

Add Row to Empty Data Frame in R (Example)   In this tutorial you'll learn how to append a new row to an empty data frame in R . The table of content looks as follows: With that, let's jump right to the example:   Creating...

### Add Subscript and Superscript to Plot in R (3 Examples)

Add Subscript and Superscript to Plot in R (3 Examples)   In this tutorial, I'll explain how to create a subscript or superscript in R . The tutorial consists of three examples for the addition of subscripts and superscripts. To be more...

### Add Table to ggplot2 Plot in R (Example)

Add Table to ggplot2 Plot in R (Example)   In this R article you'll learn how to draw a data frame table to a ggplot2 plot . The post is structured as follows: Let's just jump right in.   Example Data, Add-On Packages...

### Add Text to ggplot2 Plot in R (3 Examples)

Add Text to ggplot2 Plot in R (3 Examples)   In this article you'll learn how to annotate text elements to ggplot2 graphics in R programming . The article will contain the following contents: Let's dig in!   Example Data,...

### Add Text to Plot Using text() Function in Base R (3 Examples)

Add Text to Plot Using text() Function in Base R (3 Examples)   In this tutorial, I'll illustrate how to add text to graphics using the text() function in the R programming language . The article consists of the following contents: Let's...

### Add Time to Date Object in R (Example)

Add Time to Date Object in R (Example)   This article illustrates how to add a time stamp to a POSIXct object in the R programming language . Table of contents: So now the part you have been waiting for - the examples.   Creation...

### Add Vertical & Horizontal Line to gglot2 Plot in R (4 Examples)

Add Vertical & Horizontal Line to gglot2 Plot in R (4 Examples)   In this tutorial you'll learn how to draw vertical and horizontal lines to a ggplot2 graph in R programming . The article will consist of four examples for the drawing of...

### Add X & Y Axis Labels to ggplot2 Plot in R (Example)

Add X & Y Axis Labels to ggplot2 Plot in R (Example)   This article illustrates how to create user-defined axis labels in a ggplot2 plot in the R programming language . Table of contents: Creating Example Data Example: Adding Axis...

### Adjust Space Between ggplot2 Axis Labels and Plot Area in R (2 Examples)

Adjust Space Between ggplot2 Axis Labels and Plot Area in R (2 Examples)   In this R programming tutorial , I'll explain how to adjust the space between the ggplot2 axis labels and the plot area . The article contains the following content: Creation...

### Aggregate Daily Data to Month & Year Intervals in R (2 Examples)

Aggregate Daily Data to Month & Year Intervals in R (2 Examples)   In this R tutorial you'll learn how to summarize and group daily data into monthly intervals . The tutorial will contain two examples for the aggregation of daily data....

### aggregate Function in R (3 Examples)

aggregate Function in R (3 Examples)   In this tutorial you'll learn how to apply the aggregate function in the R programming language . The table of content looks like this: It's time to dive into the examples: Definition &...

### all_equal Function of dplyr R Package (2 Examples)

all_equal Function of dplyr R Package (2 Examples)   This article explains how to use the all_equal function of the dplyr package in the R programming language . Table of contents: Creating Exemplifying Data Example 1: Compare...

### Annotate Multiple Lines of Text to ggplot2 Plot in R (Example)

Annotate Multiple Lines of Text to ggplot2 Plot in R (Example)   In this R programming tutorial you'll learn how to add a text element with two or more lines to a ggplot2 graph . The article consists of this information: Let's jump...

### Annotate Text Outside of ggplot2 Plot in R (Example)

Annotate Text Outside of ggplot2 Plot in R (Example)   In this tutorial, I'll explain how to add text outside of the plot area of a ggplot2 graph in R . The tutorial looks as follows: Here's the step-by-step process...   Example...

### Append to Data Frame in Loop in R (2 Examples) | Add Column / Row in for-Loop

Append to Data Frame in Loop in R (2 Examples) | Add Column / Row in for-Loop   In this tutorial you'll learn how to add new columns and rows within loops in the R programming language . Table of contents: Let's get started!   Creation...

### Append to List in Loop in R (Example) | Add Element in while- & for-Loops

Append to List in Loop in R (Example) | Add Element in while- & for-Loops   In this R post you'll learn how to add new elements to a list within a for-loop . The tutorial will contain this information: Let's dive into it.   Creation...

### Append to Vector in Loop in R (Example) | Add Value in while- & for-Loops

Append to Vector in Loop in R (Example) | Add Value in while- & for-Loops   In this tutorial you'll learn how to add new vector elements in a for-loop in the R programming language . Table of contents: Let's take a look at some...

### Append Value to Vector in R (4 Examples)

Append Value to Vector in R (4 Examples)   In this tutorial you'll learn how to append a new value to a vector in the R programming language . The table of content is structured as follows: Creating Example Data Example 1: Append...

### Apply Function to data.table in Each Specified Column in R (Example)

Apply Function to data.table in Each Specified Column in R (Example)   This page shows how to use the same function for a predefined set of variables in the R programming language . Table of contents: Let's take a look at some R...

### Apply Function to Every Row of Data Frame or Matrix in R (Example)

Apply Function to Every Row of Data Frame or Matrix in R (Example)   On this page you'll learn how to use a function for each row of a data frame or matrix in the R programming language . The page is structured as follows: Creating...

### Apply Function to Every Row of Data Using dplyr Package in R | rowwise Function Explained

Apply Function to Every Row of Data Using dplyr Package in R | rowwise Function Explained   In this R tutorial you'll learn how to apply a function to each row of a data frame or tibble with the dplyr package of the tidyverse . This...

### apply Functions in R (6 Examples) | lapply, sapply, vapply, tapply & mapply

apply Functions in R (6 Examples) | lapply, sapply, vapply, tapply & mapply   In this article you'll learn how to use the family of apply functions in the R programming language . The content of the post looks as follows: So without...

### Apply unique Function to Multiple Columns in R (2 Examples)

Apply unique Function to Multiple Columns in R (2 Examples)   On this page you'll learn how to retain only data frame rows that are unique in certain variables in the R programming language . The article looks as follows: Let's...

### apropos & find Functions in R (2 Examples)

apropos & find Functions in R (2 Examples)   This tutorial explains how to find objects by (partial) names in the R programming language . The tutorial will be based on the functions apropos() and find(). Let's have a look at the basic...

### arrange Function of dplyr R Package (2 Examples)

arrange Function of dplyr R Package (2 Examples)   In this R article you'll learn how to order data sets with the arrange function of the dplyr package . Table of contents: Example Data Example 1: Arrange Data By One Variable...

### Arrange List of ggplot2 Plots in R (Example)

Arrange List of ggplot2 Plots in R (Example)   On this page you'll learn how to draw a list of ggplot2 plots side-by-side in the R programming language . Table of contents: Let's take a look at some R codes in action.   Example...

### as.Date Function in R (Example)

as.Date Function in R (Example)   In this tutorial, I'll illustrate how to convert a character to the Date class using the as.Date function in R . The tutorial will contain the following content: Let's take a look at some R codes...

### as.double & is.double Functions in R (2 Examples)

as.double & is.double Functions in R (2 Examples)   In this article, I'll explain how to apply the as.double and is.double functions in the R programming language . The article is structured as follows: Sound good? Let's dive right...

### as.name & is.name Functions in R (2 Examples)

as.name & is.name Functions in R (2 Examples)   This tutorial explains how to apply the as.name and is.name functions in the R programming language . The article will consist of two examples for the application of the as.name and is.name...

### as.tbl & is.tbl R Functions of dplyr Package (2 Examples)

as.tbl & is.tbl R Functions of dplyr Package (2 Examples)   In this article you'll learn how to create and check tibbles with the as.tbl and is.tbl functions of the dplyr package in R . The content looks as follows: Creation of Example...

### asp in R Plot (2 Example Codes) | Set Aspect Ratio of Scatterplot & Barplot

asp in R Plot (2 Example Codes) | Set Aspect Ratio of Scatterplot & Barplot   In this R tutorial, I'm going to show you how to use the asp option to set the aspect ratio of a plot, i.e. the proportional relationship between width and height...

### Assign Column Names Based On Existing Row in R (2 Examples)

Assign Column Names Based On Existing Row in R (2 Examples)   This tutorial illustrates how to convert the values in a row to the header of a data frame in R . The page looks as follows: Here's how to do it:   Creation...

### Assign Fixed Colors to Categorical Variable in ggplot2 Plot in R (Example)

Assign Fixed Colors to Categorical Variable in ggplot2 Plot in R (Example)   This page shows how to assign pre-defined colors to qualitative variables in a ggplot2 plot in R programming . Table of contents: Creating Example Data ...

### assign Function in R (2 Examples)

assign Function in R (2 Examples)   In this tutorial, I'll illustrate how to assign values to a variable name using the assign() function in R . Table of contents: Sound good? Great, here's how to do it... Definition & Basic...

### Assign Value to Elements in Certain Range in R (Example)

Assign Value to Elements in Certain Range in R (Example)   In this tutorial, I'll show how to replace the values in a certain range by a new value in the R programming language . Table of contents: Sound good? Let's dive right into...

### Assignment Operators in R (3 Examples) | Comparing = vs. ＜- vs. ＜＜-

Assignment Operators in R (3 Examples) | Comparing = vs. ＜- vs. ＜＜-   On this page you'll learn how to apply the different assignment operators in the R programming language . The content of the article is structured as follows: Let's dive ...

### attach & detach Functions in R | 2 Examples: Data Frame & Package

attach & detach Functions in R | 2 Examples: Data Frame & Package   In this article I will show you how to handle data.frames with the attach and detach functions in R . Let’s start with the basic R syntax and the definition of the two f...

### attr, attributes & structure Functions in R | 4 Examples (get, remove & set)

attr, attributes & structure Functions in R | 4 Examples (get, remove & set)   In the following R tutorial, I’m going to show you three functions, with which you can get or set the attributes of your data: attributes function (Examples 1...

### Avoid for-Loop in R? (Alternatives) | Using lapply Function Instead

Avoid for-Loop in R? (Alternatives) | Using lapply Function Instead   In this R tutorial you'll learn how to use the lapply function instead of for-loops . The article will consist of this content: If you want to know more about...

### Barplot in R (8 Examples) | How to Create Barchart & Bargraph in RStudio

Barplot in R (8 Examples) | How to Create Barchart & Bargraph in RStudio   In this post you'll learn how to draw a barplot (or barchart, bargraph) in R programming . The page consists of eight examples for the creation of barplots. More...

### Bernoulli Distribution in R (4 Examples) | dbern, pbern, qbern & rbern Functions

Bernoulli Distribution in R (4 Examples) | dbern, pbern, qbern & rbern Functions   In this R tutorial you'll learn how to apply the Bernoulli distribution functions . Table of contents: Example 1: Bernoulli Probability Density Function...

### Beta Distribution in R (4 Examples) | dbeta, pbeta, qbeta & rbeta Functions

Beta Distribution in R (4 Examples) | dbeta, pbeta, qbeta & rbeta Functions   This article shows how to use the beta functions in R programming . The content of the page looks as follows: Example 1: Beta Density in R (dbeta Function)...

### between Function of dplyr R Package (2 Examples)

between Function of dplyr R Package (2 Examples)   In this tutorial, I'll illustrate how to test whether a numeric value falls into a specified range with the between function of the dplyr package in R . Table of contents: Example...

### bind_rows & bind_cols R Functions of dplyr Package (2 Examples)

bind_rows & bind_cols R Functions of dplyr Package (2 Examples)   In this article, I'll explain how to merge rows and columns with the bind_rows and bind_cols functions of the dplyr package in R . The table of content is structured like...

### Binomial Distribution in R (4 Examples) | dbinom, pbinom, qbinom & rbinom Functions

Binomial Distribution in R (4 Examples) | dbinom, pbinom, qbinom & rbinom Functions   In this tutorial you'll learn how to apply the binom functions in R programming . The tutorial is structured as follows: Example 1: Binomial Density...

### Boxplot in R (9 Examples) | Create a Box-and-Whisker Plot in RStudio

Boxplot in R (9 Examples) | Create a Box-and-Whisker Plot in RStudio   In this tutorial, I'll show how to draw boxplots in R . The tutorial will contain these topics: Example 1: Basic Box-and-Whisker Plot in R Example 2: Multiple...

### break & next Functions in R for-loop (2 Examples)

break & next Functions in R for-loop (2 Examples)   This tutorial shows how to use the break and next commands within a for-loop in R . Without further ado, let's move directly to the examples!   Create Basic for-loop in R (without...

### c() Function in R (2 Examples)

c() Function in R (2 Examples)   This article illustrates how to combine values into a vector or list using the c() function in R . The content looks as follows: Here's the step-by-step process... Definition & Basic R Syntax...

### Calculate Combinations & Permutations in R (4 Examples)

Calculate Combinations & Permutations in R (4 Examples)   In this R tutorial you'll learn how to generate and count all possible permutations and combinations of the elements in a vector . The tutorial will contain the following information: Before...

### Calculate Correlation Matrix Only for Numeric Columns in R (2 Examples)

Calculate Correlation Matrix Only for Numeric Columns in R (2 Examples)   In this tutorial, I'll explain how to apply the cor function only to numeric variables in the R programming language . The content is structured as follows: If...

### Calculate Critical t-Value in R (3 Examples)

Calculate Critical t-Value in R (3 Examples)   In this article, I'll illustrate how to calculate critical t-values in R . Table of contents: So without further additions, let's dive right into the examples.   Example...

### Calculate Euclidean Norm of Vector in R (Example)

Calculate Euclidean Norm of Vector in R (Example)   In this R tutorial you'll learn how to compute the Euclidean Norm . The content of the post is structured like this: Let's start right away:   Creation of Example Data...

### Calculate Moving Average, Maximum, Median & Sum of Time Series in R (6 Examples)

Calculate Moving Average, Maximum, Median & Sum of Time Series in R (6 Examples)   This tutorial shows how to calculate moving averages, maxima, medians, and sums in the R programming language . The article looks as follows: Let's...

### Calculate Percentage in R (2 Examples)

Calculate Percentage in R (2 Examples)   In this tutorial you'll learn how to create a table of probabilities in the R programming language . Table of contents: So let's get started.   Introduction of Exemplifying Data...

### Calculate Square in R (4 Examples)

Calculate Square in R (4 Examples)   This tutorial shows how to raise the values of a data object to the power of two in the R programming language . Table of contents: Let's dive right in.   Example 1: Compute Square...

### case_when & cases Functions in R (2 Examples)

case_when & cases Functions in R (2 Examples)   This article illustrates how to apply the case_when and cases functions in R . Table of contents: You're here for the answer, so let's get straight to the examples.   Creation...

### Cauchy Density in R (4 Examples) | dcauchy, pcauchy, qcauchy & rcauchy Functions

Cauchy Density in R (4 Examples) | dcauchy, pcauchy, qcauchy & rcauchy Functions   In this R tutorial you'll learn how to apply the cauchy functions . The page contains four examples for the application of dcauchy, pcauchy, qcauchy, and...

### cbind R Command | 3 Example Codes (Data Frame, Vector & Multiple Columns)

cbind R Command | 3 Example Codes (Data Frame, Vector & Multiple Columns)   Basic R Syntax: cbind(my_data, new_column)   The name of the cbind R function stands for column-bind . The cbind function is used to combine vectors,...

### Change Axis Labels of Boxplot in R (2 Examples)

Change Axis Labels of Boxplot in R (2 Examples)   In this article, I'll illustrate how to rename the x-axis labels of a boxplot in the R programming language . The article will consist of these contents: So let's start right away...   Example...

### Change Background Color of ggplot2 Plot in R (3 Examples)

Change Background Color of ggplot2 Plot in R (3 Examples)   In this article you'll learn how to modify background colors of ggplot2 plots in the R programming language . The article consists of this content: Creation of Example Data...

### Change Background Color of ggplot2 Text Label Annotation in R (Example)

Change Background Color of ggplot2 Text Label Annotation in R (Example)   In this post, I'll explain how to add background color to a text label in a ggplot2 plot in the R programming language . The tutorial will contain one example for...

### Change Color of ggplot2 Boxplot in R (3 Examples)

Change Color of ggplot2 Boxplot in R (3 Examples)   In this tutorial you'll learn how to set the colors in a ggplot2 boxplot in the R programming language . The tutorial will contain this: Let's dive right into the examples...   Exemplifying...

### Change Color, Shape & Size of One Data Point in Plot (Base R & ggplot2)

Change Color, Shape & Size of One Data Point in Plot (Base R & ggplot2)   On this page you'll learn how to set color, shape, and size of a single data point in the R programming language . The tutorial contains these contents: Let's...

### Change Colors in ggplot2 Line Plot in R (Example)

Change Colors in ggplot2 Line Plot in R (Example)   In this article you'll learn how to adjust the colors of a ggplot2 line graph in R programming . The post consists of this content: Let's just jump right in:   Example...

### Change Colors of Axis Labels & Values of Base R Plot (2 Examples)

Change Colors of Axis Labels & Values of Base R Plot (2 Examples)   In this R tutorial you'll learn how to modify the colors of axis labels and values in a plot . Table of contents: You're here for the answer, so let's get straight...

### Change Colors of Bars in ggplot2 Barchart in R (2 Examples)

Change Colors of Bars in ggplot2 Barchart in R (2 Examples)   In this tutorial you'll learn how to modify the color of a ggplot2 barchart in the R programming language . Table of contents: Let's take a look at some R codes in action!   Example...

### Change Colors of Ranges in ggplot2 Heatmap in R (2 Examples)

Change Colors of Ranges in ggplot2 Heatmap in R (2 Examples)   In this tutorial you'll learn how to modify the colors of value ranges in a ggplot2 heatmap in R programming . The article looks as follows: With that, let's dive right...

### Change Default Working Directory in R & RStudio (Step-by-Step Example)

Change Default Working Directory in R & RStudio (Step-by-Step Example)   On this article, I'll explain how to set the default working directory in R or RStudio . The page will contain a step-by-step instruction on how to change the default...

### Change Display Order of ggplot2 Plot Legend in R (Example)

Change Display Order of ggplot2 Plot Legend in R (Example)   In this post you'll learn how to modify the ordering of legend items of a ggplot2 graph in the R programming language . The tutorial will contain these content blocks: Let's...

### Change Fill and Border Color of ggplot2 Plot in R (Example)

Change Fill and Border Color of ggplot2 Plot in R (Example)   In this article, I'll explain how to modify fill and border colors of a ggplot2 graphic in the R programming language . The tutorial will contain these topics: Let's...

### Change Font of Plot in R (3 Examples)

Change Font of Plot in R (3 Examples)   In this tutorial, I'll illustrate how to select fonts of plots manually in R . The article will contain three examples for the modification of font families in plots. More precisely, the content...

### Change Font Size of ggplot2 Facet Grid Labels in R (Example)

Change Font Size of ggplot2 Facet Grid Labels in R (Example)   In this R tutorial you'll learn how to increase or decrease the text size of the labels of a ggplot2 facet grid . Table of contents: Creating Example Data Example:...

### Change Font Size of ggplot2 Plot in R (5 Examples) | Axis Text, Main Title & Legend

Change Font Size of ggplot2 Plot in R (5 Examples) | Axis Text, Main Title & Legend   In this article, I'll explain how to increase and decrease the text font sizes of ggplot2 plots in R . The tutorial consists of these content blocks: Example...

### Change Format of Dates in R (4 Examples)

Change Format of Dates in R (4 Examples)   In this post you'll learn how to modify the structure of date objects in R programming . The page will contain the following content: Let's get started...   Example Data First,...

### Change Formatting of Numbers of ggplot2 Plot Axis in R (Example)

Change Formatting of Numbers of ggplot2 Plot Axis in R (Example)   In this tutorial you'll learn how to modify the formatting of axis values in a ggplot2 graph in R programming . The tutorial is structured as follows: Creation of...

### Change ggplot2 Color & Fill Using scale_brewer Functions & RColorBrewer Package in R

Change ggplot2 Color & Fill Using scale_brewer Functions & RColorBrewer Package in R   In this article, I'll explain how to apply the functions of the RColorBrewer package to modify ggplot2 plot colors in the R programming language . The...

### Change Index Numbers of Data Frame Rows in R (2 Examples)

Change Index Numbers of Data Frame Rows in R (2 Examples)   This article shows how to modify or reset all index numbers of a data frame in R . The article contains two examples for the modification of indices. More precisely, the tutorial...

### Change Labels of ggplot2 Facet Plot in R (Example)

Change Labels of ggplot2 Facet Plot in R (Example)   This article illustrates how to modify the facet labels of a ggplot2 facet plot in the R programming language . Table of contents: Let's do this...   Example Data,...

### Change Legend Labels of ggplot2 Plot in R (2 Examples)

Change Legend Labels of ggplot2 Plot in R (2 Examples)   In this post, I'll explain how to modify the text labels of a ggplot2 legend in R programming . The tutorial will consist of these content blocks: Let's start right away!   Exemplifying...

### Change Legend Size in Base R Plot (2 Examples)

Change Legend Size in Base R Plot (2 Examples)   In this R tutorial you'll learn how to adjust the size of a plot legend . The article will contain the following topics: Let's dive right into the examples:   Introduction...

### Change Legend Title in ggplot2 (2 Example Codes) | Modify Text of ggplot Legends

Change Legend Title in ggplot2 (2 Example Codes) | Modify Text of ggplot Legends   This article explains how to change the text of a ggplot2 legend in R . The tutorial is structured as follows: Example Data Change Legend Text with...

### Change Line Width in ggplot2 Plot in R (Example)

Change Line Width in ggplot2 Plot in R (Example)   This article explains how to control the width of a ggplot2 line graphic in R programming . The tutorial consists of the following content: Creating Example Data & Default ggplot2...

### Change Point Size in ggplot2 Scatterplot in R (2 Examples)

Change Point Size in ggplot2 Scatterplot in R (2 Examples)   In this article, I'll demonstrate how to increase or decrease the size of points in a ggplot2 scatterplot in R . Table of contents: Sound good? Let's take a look at some...

### Change Position of ggplot Title in R (4 Examples) | Adjust to Center, Right-Aligned or Vertical Positioning

Change Position of ggplot Title in R (4 Examples) | Adjust to Center, Right-Aligned or Vertical Positioning   This article explains how to adjust the title position of a ggplot in R . The tutorial will be structured as follows: Example...

### Change Row Names of Data Frame or Matrix in R (4 Examples)

Change Row Names of Data Frame or Matrix in R (4 Examples)   In this tutorial, I'll illustrate how to modify the row names of a data frame or matrix in the R programming language . The post consists of this: Let's dive into it.   Creation...

### Change Space & Width of Bars in ggplot2 Barplot in R (2 Examples)

Change Space & Width of Bars in ggplot2 Barplot in R (2 Examples)   In this article, I'll illustrate how to modify space and width of bars in a ggplot2 barchart in R programming . Table of contents: Let's do this!   Example...

### Change Spacing Between Horizontal Legend Items of ggplot2 Plot in R (Example)

Change Spacing Between Horizontal Legend Items of ggplot2 Plot in R (Example)   This tutorial illustrates how to add additional space between horizontally aligned legend items in a ggplot2 graph in the R programming language . The tutorial...

### Change Spacing of Axis Tick Marks in Base R Plot (2 Examples)

Change Spacing of Axis Tick Marks in Base R Plot (2 Examples)   In this article you'll learn how to modify the space between axis ticks of a Base R plot in R programming . The tutorial consists of the following topics: Let's get...

### Change Y-Axis to Percentage Points in ggplot2 Barplot in R (2 Examples)

Change Y-Axis to Percentage Points in ggplot2 Barplot in R (2 Examples)   In this R tutorial you'll learn how to set the axis labels of a barchart in percentage points . The tutorial contains this: Let's dive right into the examples...   Example...

### Check Existence of Local File in R (2 Examples)

Check Existence of Local File in R (2 Examples)   This tutorial explains how to test whether a file exists in a local directory in the R programming language . The post is structured as follows: Here's the step-by-step process:   Example...

### Check if Column Exists in Data Frame in R (Example)

Check if Column Exists in Data Frame in R (Example)   In this R tutorial you'll learn how to inspect whether a variable exists in a data frame . Table of contents: Example Data Example: Search for Column Name in Data Frame Video,...

### Check if Number is Integer in R (3 Examples)

Check if Number is Integer in R (3 Examples)   In this R tutorial you'll learn how to test whether a number is an integer (i.e. a whole number). Table of contents: Example Data Example 1: Check if Number is Integer with round...

### Check if Object is Defined (exists in R) | 4 Examples: Vector, Variable, Function, Error

Check if Object is Defined (exists in R) | 4 Examples: Vector, Variable, Function, Error   In this R tutorial, I'll show you how to check whether a data object exists in your R programming environment. The tutorial is mainly relying on the...

### Check if Package is Missing and Install Automatically (R Programming Example)

Check if Package is Missing and Install Automatically (R Programming Example)   On this page you'll learn how to install missing package automatically in the R programming language . The post contains these topics: Example: Install...

### Check If Two Data Frames are the Same in R (2 Examples)

Check If Two Data Frames are the Same in R (2 Examples)   In this tutorial you'll learn how to test if two data frames contain identical columns in the R programming language . The tutorial will consist of these topics: Let's just...

### Check in R if a Directory Exists and Create if It doesn't (Programming Example)

Check in R if a Directory Exists and Create if It doesn't (Programming Example)   This R tutorial explains how to check for the existence of a directory and create a new directory if it doesn't exist . The article contains the following...

### Chi Square Distribution in R (4 Examples) | dchisq, pchisq, qchisq & rchisq Functions

Chi Square Distribution in R (4 Examples) | dchisq, pchisq, qchisq & rchisq Functions   In this R tutorial you'll learn how to apply the chi square functions . The content of the article is structured as follows: Example 1: Chi Square...

### Clear All Plots in RStudio Using R Code (Example)

Clear All Plots in RStudio Using R Code (Example)   This article shows how to remove all plots that are shown in RStudio in the R programming language . Table of contents: Let's get started...   Creation of Example Plots...

### Clear Data Object from Workspace in R (3 Examples) | rm & remove Functions

Clear Data Object from Workspace in R (3 Examples) | rm & remove Functions   In this R tutorial you'll learn how to clear specific data objects from the R workspace . The tutorials relies mainly on the rm() and remove() functions. The...

### Clear R and RStudio Console (2 Examples)

Clear R and RStudio Console (2 Examples)   This article explains how to clear the console in R and RStudio . I will show you two alternatives for clearing the console. More precisely, this article contains the following contents: Clear...

### coalesce R Function of dplyr Package (2 Examples)

coalesce R Function of dplyr Package (2 Examples)   In this article you'll learn how to apply the coalesce function of the dplyr add-on package in R programming . The table of content looks as follows: Example 1: Use coalesce Function...

### Color Scatterplot Points in R (2 Examples)

Color Scatterplot Points in R (2 Examples)   In this tutorial, I'll illustrate how to draw a scatterplot with colors in R programming . The article will consist of the following content blocks: Let's start right away!   Example...

### Coloring Plot by Factor in R (2 Examples)

Coloring Plot by Factor in R (2 Examples)   This tutorial shows how to specify graphic colors according to a factor in the R programming language . The content of the page is structured as follows: Let's dive right in!   Creation...

### colSums, rowSums, colMeans & rowMeans in R | 5 Example Codes + Video

colSums, rowSums, colMeans & rowMeans in R | 5 Example Codes + Video   In this tutorial, I'll show you how to use four of the most important R functions for descriptive statistics: colSums, rowSums, colMeans, and rowMeans. I'll explain...

### Combine Multiple ggplot2 Legends in R (Example)

Combine Multiple ggplot2 Legends in R (Example)   In this R tutorial you'll learn how to create only a single ggplot2 legend . The post looks as follows: It's time to dive into the R syntax:   Example Data, Packages &...

### combine R Function of dplyr Package (2 Examples)

combine R Function of dplyr Package (2 Examples)   In this R tutorial you'll learn how to apply the combine function of the dplyr add-on package . The tutorial looks as follows: Example 1: Basic Application of combine() in Comparison...

### Combine Two Data Frames with Different Variables by Rows in R (Example)

Combine Two Data Frames with Different Variables by Rows in R (Example)   In this tutorial you'll learn how to join two data frames with a different set of variable names in R . The table of content is structured like this: It's...

### Combine Two ggplot2 Plots from Different Data Frames in R (Example)

Combine Two ggplot2 Plots from Different Data Frames in R (Example)   In this article you'll learn how to draw a ggplot2 plot based on several different data sources in the R programming language . Table of contents: Let's do this...   Example...

### Combine Two Vectors into Data Frame or Matrix in R (2 Examples)

Combine Two Vectors into Data Frame or Matrix in R (2 Examples)   In this tutorial, I'll illustrate how to merge two vector objects in a data frame or matrix in R . Table of contents: Let's just jump right in!   Creation...

### Comment Out Block of Code in R (3 Examples)

Comment Out Block of Code in R (3 Examples)   In this tutorial you'll learn how to comment out an entire block of code in R . Table of contents: If you want to know more about these contents, keep reading.   Introduction...

### Common Main Title for Multiple Plots in Base R & ggplot2 (2 Examples)

Common Main Title for Multiple Plots in Base R & ggplot2 (2 Examples)   In this tutorial, I'll explain how to draw a grid of plots with a shared main title in the R programming language . Table of contents: Let's dig in.   Example...

### Compare Character Strings with Logical Operator Conditionally in R (3 Examples)

Compare Character Strings with Logical Operator Conditionally in R (3 Examples)   This post illustrates how to compare character string vectors using logical operators in R . The content of the tutorial looks as follows: Let's dive...

### Compare Vectors and Find Differences in R (5 Examples)

Compare Vectors and Find Differences in R (5 Examples)   This page illustrates how to identify similarities and differences between two vector objects in the R programming language . Table of contents: Let's do this...   Example...

### Complete Cases in R (3 Programming Examples)

Complete Cases in R (3 Programming Examples) A complete data set (i.e. data without any missing values) is essential for many types of data analysis in the programming language R . In order to deal with missing data , it is crucial to find missing...

### Compute Mean of Data Frame Column in R (6 Examples)

Compute Mean of Data Frame Column in R (6 Examples)   This article illustrates how to calculate the mean of a data frame column in the R programming language . Table of contents: Let's just jump right in.   Creation of...

### Compute z-score in R (2 Examples)

Compute z-score in R (2 Examples)   This article shows how to calculate z-scores (also called standard scores, z-values, normal scores, and standardized variables) in the R programming language. The content of the page is structured as...

### Concatenate Two Matrices in R (2 Examples)

Concatenate Two Matrices in R (2 Examples)   In this tutorial, I'll illustrate how to append two matrices in the R programming language . The tutorial consists of these contents: Here's how to do it.   Creation of Example...

### Concatenate Vector of Character Strings in R (2 Examples) | How to Combine Text Cases

Concatenate Vector of Character Strings in R (2 Examples) | How to Combine Text Cases   In this article, I’ll explain how to concatenate a vector of character strings in the R programming language . The table of contents is as follows: Creating E...

### Conditionally Remove Row from Data Frame in R (3 Examples) | How to Delete Rows

Conditionally Remove Row from Data Frame in R (3 Examples) | How to Delete Rows   This page explains how to conditionally delete rows from a data frame in R programming . The article will consist of this: Creation of Example Data...

### Continuous Uniform Distribution in R (4 Examples) | dunif, punif, qunif & runif Functions

Continuous Uniform Distribution in R (4 Examples) | dunif, punif, qunif & runif Functions   This page explains how to apply the uniform distribution functions in the R programming language . The content of the post is structured like this: Example...

### Control Line Color & Type in ggplot2 Plot Legend in R (Example)

Control Line Color & Type in ggplot2 Plot Legend in R (Example)   In this article, I'll show how to modify the lines and colors of a ggplot2 legend in the R programming language . The content is structured as follows: Let's jump...

### Control Point Border Thickness of ggplot2 Scatterplot in R (Example)

Control Point Border Thickness of ggplot2 Scatterplot in R (Example)   This article explains how to modify the thickness of point borders in a ggplot2 scatterplot in R programming . The post will consist of this content: Let's just...

### Control Size of ggplot2 Legend Items in R (Example) | How to Adjust Symbols

Control Size of ggplot2 Legend Items in R (Example) | How to Adjust Symbols   This tutorial explains how to adjust the size of ggplot2 legend symbols in R . The tutorial contains this: Here's how to do it!   Example Data,...

### Control the Size of the Points in a Scatterplot in R (Example)

Control the Size of the Points in a Scatterplot in R (Example)   In this article, I'll show how to increase or decrease the point size in a scatterplot in the R programming language . The tutorial will consist of one example. To be more...

### Convert All Character String Variables in Data Frame to Uppercase in R (Example)

Convert All Character String Variables in Data Frame to Uppercase in R (Example)   In this tutorial, I'll illustrate how to change lower case letters in character variables to uppercase in the R programming language . The content of the...

### Convert Categorical Variable to Numeric in R (2 Examples)

Convert Categorical Variable to Numeric in R (2 Examples)   This post shows how to convert a categorical variable to numeric in the R programming language . Table of contents: It's time to dive into the examples...   Example...

### Convert Character Matrix to Numeric in R (Example)

Convert Character Matrix to Numeric in R (Example)   In this tutorial, I'll show how to set all columns of a character matrix to numeric in R programming . The table of content looks as follows: Let's do this!   Constructing...

### Convert Character String to Date Object in R (Example)

Convert Character String to Date Object in R (Example)   In this tutorial, I'll explain how to change the character string format to the date class in R . The article consists of one example for the conversion of characters to dates. More...

### Convert Character String to Variable Name in R (2 Examples)

Convert Character String to Variable Name in R (2 Examples)   In this article you'll learn how to use a character string as variable name in the R programming language . The article will consist of the following topics: Example 1:...

### Convert Character to Factor in R (3 Examples)

Convert Character to Factor in R (3 Examples)   This article shows how to convert characters to factors in the R programming language . Table of contents: Example 1: Convert Character Vector to Factor Example 2: Convert Character...

### Convert Column Classes of Data Table in R (2 Examples)

Convert Column Classes of Data Table in R (2 Examples)   In this R tutorial you'll learn how to convert the data types of the variables of a data.table . The tutorial will contain two examples for the conversion of data classes. To be...

### Convert Data Frame Column to Numeric in R (2 Examples) | Change Factor, Character & Integer

Convert Data Frame Column to Numeric in R (2 Examples) | Change Factor, Character & Integer   In this R tutorial, I'll explain how to convert a data frame column to numeric in R . No matter if you need to change the class of factors, characters,...

### Convert Data Frame Column to Vector in R (3 Examples)

Convert Data Frame Column to Vector in R (3 Examples)   In this article you'll learn how to convert a data frame column to a vector in R programming . The tutorial contains three examples for the conversion of data frame columns. To be...

### Convert Data Frame Columns to List Elements in R (2 Examples)

Convert Data Frame Columns to List Elements in R (2 Examples)   In this article you'll learn how to convert data frame variables to list elements in the R programming language . The tutorial consists of these contents: Let's do...

### Convert Data Frame Row to Vector in R (Example)

Convert Data Frame Row to Vector in R (Example)   In this article, I'll illustrate how to extract a row from a data frame and convert it to a vector in the R programming language . Table of contents: Creation of Example Data Example:...

### Convert Data Frame Rows to List in R (Example)

Convert Data Frame Rows to List in R (Example)   In this post you'll learn how to store each row of a data frame as a list element in R programming . Table of contents: Creation of Exemplifying Data Example: How to Store Each Row...

### Convert Data Frame to Matrix in R (2 Examples)

Convert Data Frame to Matrix in R (2 Examples)   This article illustrates how to change a data object from data.frame to matrix class in the R programming language . The tutorial contains these topics: Let's take a look at some...

### Convert Data Frame with Date Column to Time Series Object in R (Example)

Convert Data Frame with Date Column to Time Series Object in R (Example)   In this article you'll learn how to change the data frame class to the xts / zoo data type in the R programming language . Table of contents: Let's take...

### Convert data.frame to data.table in R (Example)

Convert data.frame to data.table in R (Example)   In this tutorial you'll learn how to change a data.frame to data.table class in R . The content of the article is structured as follows: Let's dig in...   Introducing...

### Convert Date to Day of Week in R (3 Examples) | How to Find the Weekday

Convert Date to Day of Week in R (3 Examples) | How to Find the Weekday   In this article, I'll explain how to find the weekday of a date in R . The tutorial is structured as follows Creation of Example Data in R Find Weekday...

### Convert Date to Numeric Time Object in R (Example)

Convert Date to Numeric Time Object in R (Example)   In this tutorial, I'll explain how to transform a date to a time object in R programming . Furthermore, I'll show how to extract the hours, minutes, and seconds of this date object . Table...

### Convert Dates to Year/Quarter Format in R (3 Examples)

Convert Dates to Year/Quarter Format in R (3 Examples)   This article illustrates how to change the format of dates to years and quarters in R . Table of contents: Let's jump right to the programming part:   Creation...

### Convert Factor to Character Class in R (3 Examples) | Change Vector & Data Frame Column

Convert Factor to Character Class in R (3 Examples) | Change Vector & Data Frame Column   In this tutorial, I'll show how to change vectors and data frame columns from factor to character class in the R programming language . The content...

### Convert Factor to Date in R (2 Examples)

Convert Factor to Date in R (2 Examples)   In this tutorial, I'll show how to change the class of a data object from factor to Date in the R programming language . The tutorial will consist of these topics: Let's start right away:   Creation...

### Convert Factor to Dummy Indicator Variables for Every Level in R (Example)

Convert Factor to Dummy Indicator Variables for Every Level in R (Example)   This page explains how to expand a factor column to dummy variables for each factor level in the R programming language . The content of the tutorial is structured...

### Convert List of Vectors to Data Frame in R (2 Examples)

Convert List of Vectors to Data Frame in R (2 Examples)   This tutorial explains how to convert a list of vectors to a data frame in the R programming language . Table of contents: Creating Example Data Example 1: Convert List...

### Convert List to Lowercase or Uppercase in R (2 Examples)

Convert List to Lowercase or Uppercase in R (2 Examples)   In this article you'll learn how to set the character strings in a list to lowercase or uppercase in R . The article consists of these content blocks: Here's the step-by-step...

### Convert List to Vector in R (2 Examples)

Convert List to Vector in R (2 Examples)   This article explains how to convert a list to a vector object in the R programming language . The article consists of this content: Let's just jump right in:   Creation of Example...

### Convert Logical to Dummy Vector in R (2 Examples)

Convert Logical to Dummy Vector in R (2 Examples)   In this tutorial, I'll show how to replace logicals by a 0/1 dummy indicator in the R programming language . The post will consist of this content: Let's get started.   Example...

### Convert Matrix to Data Frame in R (2 Examples)

Convert Matrix to Data Frame in R (2 Examples)   In this article you'll learn how to switch from matrix to data.frame class in R . The post will consist of the following content: Let's do this...   Introduction of Example...

### Convert Matrix to List of Column-Vectors in R (2 Examples)

Convert Matrix to List of Column-Vectors in R (2 Examples)   In this R article you'll learn how to divide a matrix into a list of column-vectors . The article will contain the following: Let's dig in.   Introducing Example...

### Convert Matrix to Vector in R (3 Examples)

Convert Matrix to Vector in R (3 Examples)   In this article, I'll illustrate how to switch from matrix to vector format in the R programming language . The article consists of three examples for the conversion of matrices. To be more...

### Convert Name of Data Object to Character String in R (Example)

Convert Name of Data Object to Character String in R (Example)   This page shows how to return the name of a data object as a character string in the R programming language . Table of contents: So let's do this!   Creation...

### Convert Named Vector to Data Frame in R (Example)

Convert Named Vector to Data Frame in R (Example)   In this R programming tutorial you'll learn how to convert a vector with names to the data.frame class . The page looks as follows: Let's do this.   Creation of Example...

### Convert Nested Lists to Data Frame or Matrix in R (2 Examples)

Convert Nested Lists to Data Frame or Matrix in R (2 Examples)   On this page, I'll illustrate how to store a list of lists in a data frame or matrix in the R programming language . The tutorial will consist of these topics: Let's...

### Convert Numeric Values to Month Names & Abbreviations R (2 Examples)

Convert Numeric Values to Month Names & Abbreviations R (2 Examples)   In this article, I'll illustrate how to extract month names and abbreviations based on a numeric month vector in R . Table of contents: Let's get started.   Creating...

### Convert Row Names into Column of Data Frame in R (Example)

Convert Row Names into Column of Data Frame in R (Example)   This tutorial illustrates how to use the row names of a data frame as variable in R . The content of the page looks as follows: Creation of Example Data Example 1: Convert...

### Convert Table to Data Frame in R (Example)

Convert Table to Data Frame in R (Example)   In this R programming tutorial you'll learn how to convert a table to a data.frame . The page looks as follows: Creation of Example Data Example: Converting table to data.frame Video,...

### Convert UNIX Timestamp to Date Object in R (2 Examples)

Convert UNIX Timestamp to Date Object in R (2 Examples)   In this tutorial, I'll explain how to convert UNIX epoch time objects to a date object in R programming . The content of the page looks as follows: Let's get started...   Example...

### Convert Values in Column into Row Names of Data Frame in R (Example)

Convert Values in Column into Row Names of Data Frame in R (Example)   In this post you'll learn how to use variable values as row names in R programming . Table of contents: Creating Example Data Example 1: Use Variable Values...

### Convert Vector to List in R (Example)

Convert Vector to List in R (Example)   In this R article you'll learn how to convert a vector object to a list . The article will consist of one example for the conversion of vectors (or arrays) to lists. To be more specific, the tutorial...

### Convert Vector to Matrix in R (Example)

Convert Vector to Matrix in R (Example)   In this article you'll learn how to switch from vector to matrix class in R programming . The content of the page looks as follows: With that, let's get started.   Creation of...

### Correlation Matrix in R (3 Examples)

Correlation Matrix in R (3 Examples)   In this tutorial you'll learn how to compute and plot a correlation matrix in the R programming language . The article consists of three examples for the creation of correlation matrices. More precisely,...

### Count NA Values in R (3 Examples)

Count NA Values in R (3 Examples)   In this R tutorial you'll learn how to determine the number of NA values in a vector or data frame column. The page is structured as follows: Example 1: Count NA Values in Vector Example 2:...

### Count Non-Zero Values in Vector & Data Frame Columns in R (2 Examples)

Count Non-Zero Values in Vector & Data Frame Columns in R (2 Examples)   In this tutorial, I'll show how to get the number of non-zero values in the R programming language . Table of contents: Here's the step-by-step process:   Example...

### Count Number of Cases within Each Group of Data Frame in R (Example) | Counting Rows

Count Number of Cases within Each Group of Data Frame in R (Example) | Counting Rows   In this R tutorial you'll learn how to count the number of rows within data frame groups . The content looks as follows: Construction of Example...

### Count Number of Characters in String in R (2 Examples)

Count Number of Characters in String in R (2 Examples)   On this page you'll learn how to get the length of a character string in R programming . The tutorial will consist of the following: Here's the step-by-step process:   Creation...

### Count Number of List Elements in R (2 Examples)

Count Number of List Elements in R (2 Examples)   On this page, I'll show how to count the number of list elements and the number of objects within each list element in the R programming language . The tutorial will contain two examples...

### Count Number of Occurrences of Certain Character in String in R (2 Examples)

Count Number of Occurrences of Certain Character in String in R (2 Examples)   In this tutorial you'll learn how to get the number of times a specific character occurs in a string in the R programming language . The page looks as follows: Introduction...

### Count Number of Rows by Group Using dplyr Package in R (Example)

Count Number of Rows by Group Using dplyr Package in R (Example)   In this R tutorial you'll learn how to get the number of cases in each group . The article contains these topics: Let's take a look at some R codes in action...   Introducing...

### Count Number of Values in Range in R (Example)

Count Number of Values in Range in R (Example)   In this R article you'll learn how to get the number of observations within a certain range of values . The page is structured as follows: Let's dig in.   Introducing Exemplifying...

### Count Number of Words in Character String in R (Example)

Count Number of Words in Character String in R (Example)   This post explains how to get the number of words in a character string object in the R programming language . Table of contents: Let's dig in!   Creation of...

### Count Observations by Factor Level in R (3 Examples)

Count Observations by Factor Level in R (3 Examples)   In this tutorial, I'll show how to return the count of each category of a factor in R programming . The tutorial will contain the following content: Let's dive right into the...

### Count TRUE Values in Logical Vector in R (2 Examples)

Count TRUE Values in Logical Vector in R (2 Examples)   This article shows how to count the number of TRUE values in a logical vector in the R programming language . The tutorial will consist of two examples for the counting of TRUEs....

### Count Unique Values by Group in R (3 Examples)

Count Unique Values by Group in R (3 Examples)   In this post, I'll show how to get the number of distinct values in each group of a data frame in the R programming language . The article contains these topics: Here's the step-by-step...

### Count Unique Values in R (3 Examples) | Frequency of Vector or Column

Count Unique Values in R (3 Examples) | Frequency of Vector or Column   In this R tutorial you'll learn how to count the frequency of unique values of a vector or data frame column. The tutorial looks as follows: Example Data Example...

### Create a Histogram in Base R (8 Examples) | hist Function Tutorial

Create a Histogram in Base R (8 Examples) | hist Function Tutorial   In this R tutorial you'll learn how to draw histograms with Base R . The article will consist of eight examples for the creation of histograms in R. To be more precise,...

### Create Categories Based On Integer & Numeric Range in R (2 Examples)

Create Categories Based On Integer & Numeric Range in R (2 Examples)   In this tutorial you'll learn how to construct categorical variables based on integers and numeric ranges in R programming . The tutorial contains this information: Let's...

### Create Color Range Between Two Colors in R (Example)

Create Color Range Between Two Colors in R (Example)   In this R programming tutorial you'll learn how to define a color palette ranging from one color to another . The tutorial consists of these topics: Example: Create Color Palette...

### Create Comma Separated Vector in R (Example)

Create Comma Separated Vector in R (Example)   In this R article you'll learn how to create a vector separated by commas . Table of contents: Let's start right away.   Example Data As a first step, we'll have to define...

### Create Data Frame of Unequal Lengths in R (Example)

Create Data Frame of Unequal Lengths in R (Example)   In this article you'll learn how to create a data frame with columns that have an unequal length in the R programming language . Table of contents: Here's the step-by-step process:   Creation...

### Create Data Frame Row by Row in R (2 Examples)

Create Data Frame Row by Row in R (2 Examples)   In this tutorial, I'll illustrate how to construct a data frame by adding more and more rows in the R programming language . Table of contents: You're here for the answer, so let's...

### Create Data Frame where a Column is a List in R (Example)

Create Data Frame where a Column is a List in R (Example)   In this tutorial you'll learn how to construct a new data frame with a list as column in the R programming language . The content of the article is structured like this: Let's...

### Create Data Frame with n Rows & m Columns in R (Example)

Create Data Frame with n Rows & m Columns in R (Example)   In this R tutorial you'll learn how to initialize an empty data frame with particular dimensions . Table of contents: Let's dive into it.   Example: Create Empty...

### Create Data Frame with Spaces in Column Names in R (Example)

Create Data Frame with Spaces in Column Names in R (Example)   This tutorial illustrates how to retain blanks in the column names of a data frame in the R programming language . The page looks as follows: You're here for the answer,...

### Create Distinct Color Palette in R (5 Examples)

Create Distinct Color Palette in R (5 Examples)   This tutorial shows how to generate a color palette with distinct colors in R . Table of contents: Before we jump into the examples, we first have to specify the number of color...

### Create Dummy Variable in R (3 Examples)

Create Dummy Variable in R (3 Examples)   This tutorial shows how to generate dummy variables in the R programming language . The tutorial will consist of the following content blocks: So let's just jump right in...   Example...

### Create Empty Data Frame in R (2 Examples)

Create Empty Data Frame in R (2 Examples)   In this article, I'll explain how to create an empty data frame in the R programming language . I will show you two programming alternatives for the creation of an empty data frame. More precisely,...

### Create Empty Matrix in R (Example)

Create Empty Matrix in R (Example)   In this R programming article you'll learn how to create an empty matrix with zero rows . The content of the article looks as follows: You're here for the answer, so let's get straight to the...

### Create ggplot2 Histogram in R (7 Examples) | geom_histogram Function

Create ggplot2 Histogram in R (7 Examples) | geom_histogram Function   This page shows how to create histograms with the ggplot2 package in R programming . The tutorial will contain the following: Creation of Example Data & Setting...

### Create Heatmap in R (3 Examples) | Base R, ggplot2 & plotly Package

Create Heatmap in R (3 Examples) | Base R, ggplot2 & plotly Package   In this post you'll learn how to draw heatmaps in the R programming language . The content of the article is structured as follows: Construction of Example Data...

### Create Kernel Density Plot in R (7 Examples) | density() Function

Create Kernel Density Plot in R (7 Examples) | density() Function   In this R tutorial you'll learn how to draw a kernel density plot . Table of contents: Creation of Example Data Example 1: Basic Kernel Density Plot in Base R...

### Create Lagged Variable by Group in R (Example)

Create Lagged Variable by Group in R (Example)   In this R programming tutorial you'll learn how to add a column with lagged values by group to a data frame . The content is structured as follows: You're here for the answer, so...

### Create Legend in ggplot2 Plot in R (2 Examples)

Create Legend in ggplot2 Plot in R (2 Examples)   In this article you'll learn how to add a legend to a ggplot2 plot in the R programming language . The table of content is structured as follows: Creation of Example Data & Setting...

### Create List of Data Frames in R (Example)

Create List of Data Frames in R (Example)   This tutorial explains how to make a list of data frames in the R programming language . The table of content looks as follows: Example Data Example: How to Create a List of Data Frames...

### Create List of Installed Packages in R (Example)

Create List of Installed Packages in R (Example)   In this article, I'll explain how to get the names of all installed packages of a user in the R programming language . The content of the page looks as follows: Let's jump right...

### Create List of Vectors in R (Example)

Create List of Vectors in R (Example)   On this page you'll learn how to construct a list of vectors in the R programming language . Table of contents: Let's do this.   Example: Create List of Vectors Using list() Function...

### Create Matrix that Only Contains Zeros in R (2 Examples)

Create Matrix that Only Contains Zeros in R (2 Examples)   In this R tutorial you'll learn how to construct a matrix that consists only of zeros (i.e. 0). Table of contents: Let's take a look at some R codes in action.   Example...

### Create Nested List in R (2 Examples)

Create Nested List in R (2 Examples)   In this post, I'll show how to build a list of lists in the R programming language . The article contains these contents: Here's the step-by-step process!   Introducing Exemplifying...

### Create Plot Window of Particular Size in R & RStudio (3 Examples)

Create Plot Window of Particular Size in R & RStudio (3 Examples)   On this page, I'll illustrate how to open a new plot window with a specific size in the R programming language . The article will contain these content blocks: Here's...

### Create Random Matrix in R (Example)

Create Random Matrix in R (Example)   In this post, I'll explain how to fill a matrix with random values in the R programming language . Table of contents: Let's do this!   Example: Create Random Matrix Using sample()...

### Create Sequence of Repeated Values in R (Example) | Replicate N Times

Create Sequence of Repeated Values in R (Example) | Replicate N Times   In this R tutorial you'll learn how to replicate a vector sequence many times . The article will contain the following contents: Let's dive right into the example...   Creating...

### Create Variable Name Using paste() Function in R (Example)

Create Variable Name Using paste() Function in R (Example)   In this tutorial you'll learn how to create a new variable using the paste() function in the R programming language . The table of content is structured as follows: With...

### Create Vector with Intervals in R (2 Examples)

Create Vector with Intervals in R (2 Examples)   In this article you'll learn how to create a vector containing numeric intervals in the R programming language . Table of contents: If you want to know more about these contents,...

### cumall, cumany & cummean R Functions of dplyr Package (3 Examples)

cumall, cumany & cummean R Functions of dplyr Package (3 Examples)   In this R tutorial you'll learn how to apply the cumall, cumany, and cummean functions of the dplyr package . The content looks as follows: Example 1: cumall Function...

### cumsum R Function Explained (Example for Vector, Data Frame, by Group & Graph)

cumsum R Function Explained (Example for Vector, Data Frame, by Group & Graph) In many data analyses, it is quite common to calculate the cumulative sum of your variables of interest (i.e. the sum of all values up to a certain position of a vector). In...

### Cumulative Frequency & Probability Table in R (2 Examples)

Cumulative Frequency & Probability Table in R (2 Examples)   In this R tutorial you'll learn how to compute cumulative frequencies and probabilities . The content of the article is structured as follows: With that, let's start right...

### cut Function in R (Example)

cut Function in R (Example)   In this tutorial, I'll explain how to convert numeric values to factorial ranges using the cut function in R . The article contains one example for the application of cut. To be more precise, the content of...

### data.table Package in R | Tutorial & Programming Examples

data.table Package in R | Tutorial & Programming Examples   The data.table R package provides tools for data manipulation and the fast aggregation of large data sets. Here you can find the documentation of the data.table package. Here...

### Deal with Special Characters in Functions (2 Examples)

Deal with Special Characters in Functions (2 Examples)   In this R tutorial you'll learn how to deal with special characters in functions such as gsub, grepl, and gregexpr . Table of contents: Let's start right away...   Creating...

### DescTools Package in R | Tutorial & Programming Examples

DescTools Package in R | Tutorial & Programming Examples   The DescTools R package provides tools for basic statistics and convenience wrappers for an efficient data description. tools that analyze data with robust methods. This includes...

### Detach All User-Installed Packages in R (Example)

Detach All User-Installed Packages in R (Example)   In this tutorial you'll learn how to unload all currently loaded add-on packages in the R programming language . Table of contents: Setting Up the Example Example: Unload All...

### Determine Classes of All Data Frame Columns (2 Examples)

Determine Classes of All Data Frame Columns (2 Examples)   In this article you'll learn how to identify the data types of all variables of a data frame in the R programming language . Table of contents: Creation of Example Data Example...

### Determine Memory Usage of Data Objects in R (2 Examples)

Determine Memory Usage of Data Objects in R (2 Examples)   In this R tutorial you'll learn how to report the space allocated to a data object using the object.size function . Table of contents: Let's take a look at some R codes...

### Determine Path of Current Script in R (Example)

Determine Path of Current Script in R (Example)   In this tutorial, I'll explain how to find the file location of the currently executing R script in R programming . Table of contents: Let's dig in...   Example: Get File...

### diff Function in R (2 Examples) | How to Calculate the Difference in R

diff Function in R (2 Examples) | How to Calculate the Difference in R   In this article, I'll explain how to calculate differences of a vector with the diff function in R. Let's first have a look at the basic R syntax and the definition...

### Difference Between facet_grid & facet_wrap ggplot2 Functions in R (2 Examples)

Difference Between facet_grid & facet_wrap ggplot2 Functions in R (2 Examples)   In this tutorial, I'll illustrate how to use the facet_grid and facet_wrap functions of the ggplot2 package in the R programming language . The tutorial consists...

### Difference Between library & require in R (2 Examples)

Difference Between library & require in R (2 Examples)   This article shows the difference between the library and require functions in R . Table of contents: Let's get started!   Example 1: Error vs. Warning Message...

### Difference Between Single & Double Square Brackets in R (3 Examples)

Difference Between Single & Double Square Brackets in R (3 Examples)   In this article you'll learn how to use single and double square brackets in R programming . The article consists of this: You're here for the answer, so let's...

### Difference of Global & Local Variables in R (2 Examples)

Difference of Global & Local Variables in R (2 Examples)   This page shows how to use global and local variables in the R programming language . Table of contents: Here's how to do it!   Example 1: Create Function that...

### Different Colors of Points & Lines in Base R Plot Legend (Example)

Different Colors of Points & Lines in Base R Plot Legend (Example)   In this R tutorial you'll learn how to display the same legend item with different colors of points and lines . The table of content looks like this: So without...

### dir R Function | 3 Example Codes

dir R Function | 3 Example Codes   Basic R Syntax: dir(path)   The dir R function returns a character vector of file and/or folder names within a directory . The basic syntax for dir in R is illustrated above. In the following...

### Disable Messages when Loading a Package in R (Example)

Disable Messages when Loading a Package in R (Example)   In this article you'll learn how to suppress warning messages when loading an add-on package the first time in R programming . The tutorial consists of this content: Let's...

### Disable Scientific Notation in R (2 Examples) | How to Prevent Exponential Numbers

Disable Scientific Notation in R (2 Examples) | How to Prevent Exponential Numbers   In this tutorial, you will learn how to disable scientific notation (e.g. e+10) in the R programming language . The article will be structured as follows: ...

### Display All X-Axis Labels of Barplot in R (2 Examples)

Display All X-Axis Labels of Barplot in R (2 Examples)   In this tutorial, I'll show how to show every x-axis label of a barplot in R programming . The article consists of these topics: Let's dive into it...   Example...

### Display Large Numbers Separated with Comma in R (2 Examples)

Display Large Numbers Separated with Comma in R (2 Examples)   In this tutorial you'll learn how to separate numbers with a comma in the R programming language . The article consists of this content: It's time to dive into the examples!   Creation...

### Display Only Integer Values on ggplot2 Axis in R (Example)

Display Only Integer Values on ggplot2 Axis in R (Example)   In this tutorial you'll learn how to draw a ggplot2 axis containing only integers in R . The content of the page is structured as follows: Let's dive right in.   Example...

### Display Only Values in Plot in R (2 Examples)

Display Only Values in Plot in R (2 Examples)   In this tutorial, I'll demonstrate how to show only text labels in a scatterplot in the R programming language . The content of the tutorial looks as follows: Here's how to do it.   Example...

### dist Function in R (4 Examples) | Compute Euclidean & Manhattan Distance

dist Function in R (4 Examples) | Compute Euclidean & Manhattan Distance   This article illustrates how to compute distance matrices using the dist function in R . The article will consist of four examples for the application of the dist...

### Distance Along Rhumb Line in R (Example)

Distance Along Rhumb Line in R (Example)   In this R article you'll learn how to calculate the distance between two geospatial points along a loxodrome . Table of contents: Let's dive right into the exemplifying R code!   Creation...

### distinct R Function of dplyr Package (Example)

distinct R Function of dplyr Package (Example)   In this post you'll learn how to retain only unique rows of a data set with the distinct function of the dplyr package in R . Table of contents: Creation of Example Data Example:...

### Divide Each Row of Matrix & Data Frame by Vector Elements in R (2 Examples)

Divide Each Row of Matrix & Data Frame by Vector Elements in R (2 Examples)   This tutorial explains how to divide the rows of a data matrix by the elements of a vector in R . The tutorial will contain the following information: Let's...

### Divide Legend of ggplot2 Plot in R (Example)

Divide Legend of ggplot2 Plot in R (Example)   On this page you'll learn how to split a ggplot2 legend into several parts in the R programming language . The tutorial consists of the following information: You're here for the answer,...

### Divide One Column of Data Frame Through Another in R (2 Examples)

Divide One Column of Data Frame Through Another in R (2 Examples)   This tutorial shows how to divide one column of a data frame through another column of this data frame in R . The content looks as follows: Let's dig in!   Creation...

### do.call & call Functions in R (3 Examples)

do.call & call Functions in R (3 Examples)   In this post you'll learn how to apply the do.call and call functions in the R programming language . Table of contents: Let's just jump right in: Definitions & Basic R Syntaxes of...

### Don't Display Data Frame Row Names in R (Example)

Don't Display Data Frame Row Names in R (Example)   In this tutorial, I'll show how to remove row names from the RStudio console output of a data frame in R programming . The table of content is structured as follows: Let's start...

### Don't Display Quotes when Printing Character String to R Console (3 Examples)

Don't Display Quotes when Printing Character String to R Console (3 Examples)   In this R tutorial you'll learn how to remove quotes from a character string when shown in the RStudio console . The content of the tutorial looks as follows: If...

### dplyr mutate Function with Logical ifelse Condition in R (2 Examples)

dplyr mutate Function with Logical ifelse Condition in R (2 Examples)   In this tutorial you'll learn how to use the mutate function with a logical condition in the R programming language . Table of contents: Let's take a look at...

### dplyr Package in R | Tutorial & Programming Examples

dplyr Package in R | Tutorial & Programming Examples   The dplyr R package provides many tools for the manipulation of data in R. The dplyr package is part of the tidyverse environment . Here you can find the documentation of the dplyr...

### Draw Boxplot with Means in R (2 Examples)

Draw Boxplot with Means in R (2 Examples)   In this R tutorial you'll learn how to draw a box-whisker-plot with mean values . The table of content is structured as follows: Let's dive into it.   Creation of Exemplifying...

### Draw Composition of Plots Using the patchwork Package in R (3 Examples)

Draw Composition of Plots Using the patchwork Package in R (3 Examples)   On this page, I'll illustrate how to arrange multiple ggplot2 plots in a grid using the patchwork package in R . The patchwork package is a relatively new package...

### Draw Dates to X-Axis of Plot in R (2 Examples) | Time Series in Base R & ggplot2 Graph

Draw Dates to X-Axis of Plot in R (2 Examples) | Time Series in Base R & ggplot2 Graph   In this R tutorial you'll learn how to draw dates on a time series plot . Table of contents: So now the part you have been waiting for - the...

### Draw ggplot2 Legend at the Bottom & with Two Rows in R (Example)

Draw ggplot2 Legend at the Bottom & with Two Rows in R (Example)   In this R tutorial you'll learn how to move a ggplot2 legend with multiple rows to the bottom of a plot . The article will consist of the following content: Let's...

### Draw ggplot2 Legend without Plot in R (Example)

Draw ggplot2 Legend without Plot in R (Example)   In this tutorial, I'll show how to create a ggplot2 legend without plot in R programming . The article will contain these topics: Here's the step-by-step process:   Example...

### Draw ggplot2 Plot of Data Frame Subset in R (3 Examples)

Draw ggplot2 Plot of Data Frame Subset in R (3 Examples)   In this tutorial you'll learn how to create a ggplot2 plot of a data frame subset in R . The content of the page is structured as follows: Here's the step-by-step process:   Example...

### Draw ggplot2 Plot with Lines and Points in R (Example)

Draw ggplot2 Plot with Lines and Points in R (Example)   In this article you'll learn how to draw a ggplot2 plot with points and lines in the R programming language . The tutorial contains the following content: Let's start right...

### Draw ggplot2 Plot with Two Y-Axes in R (Example) | Different Scale on Each Side

Draw ggplot2 Plot with Two Y-Axes in R (Example) | Different Scale on Each Side   In this R programming tutorial you'll learn how to return a ggplot2 graph with 2 y-axes and different scales on each side . Table of contents: Let's...

### Draw Grouped Barplot in R (3 Examples)

Draw Grouped Barplot in R (3 Examples)   This tutorial illustrates how to create a bargraph with groups in the R programming language . The post will consist of this: Let's take a look at some R codes in action!   Creation...

### Draw Histogram with Logarithmic Scale in R (3 Examples)

Draw Histogram with Logarithmic Scale in R (3 Examples)   This article illustrates how to convert the x-axis of a graph to log scale in R . The article is structured as follows: It's time to dive into the examples:   Creation...

### Draw Histogram with Percentages Instead of Frequency Counts in Base R

Draw Histogram with Percentages Instead of Frequency Counts in Base R   In this article, I'll explain how to use the hist() function to draw a histogram with percent in the R programming language . The content of the article looks as follows: It's...

### Draw Legend Outside of Plot Area in Base R Graphic (Example Code)

Draw Legend Outside of Plot Area in Base R Graphic (Example Code)   On this page you'll learn how to draw a legend outside the plotting area of a Base R graphic in the R programming language . Table of contents: Introducing Example...

### Draw Multiple Boxplots in One Graph in R Side-by-Side (4 Examples)

Draw Multiple Boxplots in One Graph in R Side-by-Side (4 Examples)   In this tutorial you'll learn how to plot several boxplots side-by-side in the same graphic in the R programming language . The article will contain these content blocks: Let's...

### Draw Multiple Function Curves to Same Plot in R (2 Examples)

Draw Multiple Function Curves to Same Plot in R (2 Examples)   In this R tutorial you'll learn how to draw a graph showing several function curves . Table of contents: You're here for the answer, so let's get straight to the R syntax...   Creating...

### Draw Multiple ggplot2 Plots Side-by-Side (R Programming Example)

Draw Multiple ggplot2 Plots Side-by-Side (R Programming Example)   In this R programming tutorial you'll learn how to draw multiple ggplots side-by-side . The article is structured as follows: Create Example Data Create & Store...

### Draw Multiple Graphs & Lines in Same Plot in R (Example)

Draw Multiple Graphs & Lines in Same Plot in R (Example)   This article shows how to draw several graphs in the same plot window in the R programming language . The R tutorial is structured as follows: Step 1: Draw Plot in R Step...

### Draw Multiple lattice Plots in One Window in R (Example)

Draw Multiple lattice Plots in One Window in R (Example)   This article illustrates how to plot several lattice graphics in one grid of plots in the R programming language . Table of contents: Let's dig in:   Creation...

### Draw Multiple Overlaid Histograms with ggplot2 Package in R (Example)

Draw Multiple Overlaid Histograms with ggplot2 Package in R (Example)   In this tutorial you'll learn how to create overlaid and transparent histograms with the ggplot2 package in the R programming language . The article looks as follows: Creation...

### Draw Multiple Time Series in Same Plot in R (2 Examples)

Draw Multiple Time Series in Same Plot in R (2 Examples)   In this article you'll learn how to create a plot showing multiple time series in the R programming language . The post contains the following topics: Let's get started.   Creation...

### Draw Multiple Variables as Lines to Same ggplot2 Plot in R (2 Examples)

Draw Multiple Variables as Lines to Same ggplot2 Plot in R (2 Examples)   In this tutorial you'll learn how to plot two or more lines to only one ggplot2 graph in R programming . The article is structured as follows: You're here...

### Draw Plot of Function Curve in R (2 Examples)

Draw Plot of Function Curve in R (2 Examples)   In this R tutorial you'll learn how to create a plot showing the curve of a user-defined function . The article will contain the following content: So now the part you have been waiting...

### Draw Plot with Actual Values as Axis Ticks & Labels in R (2 Examples)

Draw Plot with Actual Values as Axis Ticks & Labels in R (2 Examples)   In this article, I'll show how to use the real values of a plot as axis ticks in the R programming language . Table of contents: It's time to dive into the...

### Draw Plot with Confidence Intervals in R (2 Examples)

Draw Plot with Confidence Intervals in R (2 Examples)   In this tutorial you'll learn how to plot a data frame with error bars using ggplot2 and plotrix in the R programming language . Table of contents: Let's just jump right in.   Creating...

### Draw Plot with Two Y-Axes in R (Example)

Draw Plot with Two Y-Axes in R (Example)   In this R programming tutorial you'll learn how to create a plot with two y-axes in Base R. Table of contents: Creation of Example Data Example: Create Plot with 2 Axes in R Video,...

### Draw Scatterplot with Labels in R (3 Examples) | Base R & ggplot2

Draw Scatterplot with Labels in R (3 Examples) | Base R & ggplot2   In this post, I'll explain how to add labels to a plot in the R programming language . The article consists of three examples for the addition of point labels. To be more...

### Draw Stacked Barplot in R (3 Examples)

Draw Stacked Barplot in R (3 Examples)   In this R tutorial you'll learn how to create a stacked barchart . Table of contents: Let's start right away!   Construction of Example Data As a first step, I'll have to create...

### Draw Time Series Plot with Events Using ggplot2 Package in R (Example)

Draw Time Series Plot with Events Using ggplot2 Package in R (Example)   This post shows how to create a time series graph containing specific events in the R programming language . Table of contents: So without further ado, let's...

### Draw Unbalanced Grid of ggplot2 Plots in R (Example)

Draw Unbalanced Grid of ggplot2 Plots in R (Example)   This page explains how to create a grid of plots with different sizes in the R programming language . The tutorial contains this content: Example Data Example: Draw Multiple...

### Draw Vertical Line to X-Axis of Class Date in ggplot2 Plot in R (Example)

Draw Vertical Line to X-Axis of Class Date in ggplot2 Plot in R (Example)   In this tutorial you'll learn how to add a geom_vline to a ggplot2 plot with dates as x-axis in the R programming language . The tutorial will contain one examples...

### Drop Multiple Columns from Data Frame Using dplyr Package in R (Example)

Drop Multiple Columns from Data Frame Using dplyr Package in R (Example)   In this R tutorial you'll learn how to remove several variables of a data frame based on functions of the dplyr package . The article is structured as follows: Let's...

### droplevels R Example | How to Drop Factor Levels of Vector & Data Frame

droplevels R Example | How to Drop Factor Levels of Vector & Data Frame   Basic R Syntax: droplevels(x)   The droplevels R function removes unused levels of a factor . The function is typically applied to vectors or data frames....

### ecdf in R (Example) | Compute & Plot the Empirical Cumulative Distribution Function

ecdf in R (Example) | Compute & Plot the Empirical Cumulative Distribution Function   This tutorial shows how to compute and plot an Empirical Cumulative Distribution Function (ECDF) in the R programming language . The article is mainly...

### Error in model.frame.default : 'data' must be a data.frame, environment, or list

Error in model.frame.default : 'data' must be a data.frame, environment, or list   In this article, I'll explain how to handle the error in model.frame.default: "'data' must be a data.frame, environment, or list" in R programming . Table...

### Error: attempt to apply non-function in R (2 Examples)

Error: attempt to apply non-function in R (2 Examples)   In this R tutorial you'll learn how to handle the error message "attempt to apply non-function" . Table of contents: Let's do this:   Example 1: Replicate the Error...

### Error: Coerce List Object to Type Double in R (2 Examples)

Error: Coerce List Object to Type Double in R (2 Examples)   In this tutorial you'll learn how to convert a list to a numeric vector in R . Table of contents: Here's how to do it!   Creation of Example Data As a first...

### Error: Unexpected ',' or '=' or ')' in R (Examples) | How to Reproduce & Fix

Error: Unexpected ',' or '=' or ')' in R (Examples) | How to Reproduce & Fix   This article shows how to deal with the errors "unexpected ',' or '=' or ')' in X" in R . The tutorial is structured as follows: Let's start right away.   Example...

### Estimate Linear Model with Fixed Intercept in R (2 Examples)

Estimate Linear Model with Fixed Intercept in R (2 Examples)   In this post you'll learn how to set a fixed intercept when estimating a linear regression model in the R programming language . The post is structured as follows: It's...

### Execution Pause for X Seconds in R (Example)

Execution Pause for X Seconds in R (Example)   This article shows how to force the R programming language to sleep for X seconds before continuing to execute. Table of contents: Measuring Execution Time of Regular For-Loop Example:...

### Exponential Distribution in R (4 Examples) | dexp, pexp, qexp & rexp Functions

Exponential Distribution in R (4 Examples) | dexp, pexp, qexp & rexp Functions   This tutorial explains how to apply the exponential functions in the R programming language . The content of the article looks as follows: Example 1:...

### Export CSV File without Row Names in R (Example)

Export CSV File without Row Names in R (Example)   In this tutorial you'll learn how to export a csv file without row names in R . Table of contents: Creation of Example Data Example: write.csv without Row Names Video & Further...

### Export List to CSV or TXT File in R (2 Examples)

Export List to CSV or TXT File in R (2 Examples)   In this R article you'll learn how to write a list object to an external file . Table of contents: Let's jump right to the examples...   Creating Example Data We'll...

### Export Multiple Data Frames to Different Excel Worksheets in R (2 Examples)

Export Multiple Data Frames to Different Excel Worksheets in R (2 Examples)   In this tutorial you'll learn how to write multiple data sets to different Excel sheets in R programming . The article looks as follows: Let's jump right...

### Export Nicely-Formatted Data Frame in R (2 Examples)

Export Nicely-Formatted Data Frame in R (2 Examples)   In this R tutorial you'll learn how to return a nicely-formatted data frame as PDF or txt file . The article consists of this content: Let's do this!   Creation of...

### Export Plot to EPS File in R (2 Examples)

Export Plot to EPS File in R (2 Examples)   In this article you'll learn how to save a graphic as EPS file in R . The article will contain the following: Let's take a look at some R codes in action:   Example Data & Default...

### Export Plot to File Using grid.arrange Function in R (2 Examples)

Export Plot to File Using grid.arrange Function in R (2 Examples)   In this tutorial you'll learn how to save a grid of plots created with the grid.arrange function to an external file in the R programming language . The article is structured...

### Extend Contingency Table with Proportions & Percentages in R (4 Examples)

Extend Contingency Table with Proportions & Percentages in R (4 Examples)   In this article, I'll illustrate how to create a table containing counts, proportions, and percentages in R . Table of contents: Let's get started...   Creation...

### Extract & Count Unique Values in Each Column of Data Frame in R (2 Examples)

Extract & Count Unique Values in Each Column of Data Frame in R (2 Examples)   This tutorial explains how to get the unique value (counts) in all data frame columns in R . The article is structured as follows: Let's do this.   Creation...

### Extract Certain Columns of Data Frame in R (4 Examples)

Extract Certain Columns of Data Frame in R (4 Examples)   This article explains how to extract specific columns of a data set in the R programming language . I will show you four programming alternatives for the selection of data frame...

### Extract Column of dplyr Tibble in R (Example)

Extract Column of dplyr Tibble in R (Example)   This article shows how to extract a certain tibble column as vector in R . The article will consist of the following contents: Creation of Example Data Example: Extract Column from...

### Extract Data Frame Rows that do not Match Logical Condition in R (Example)

Extract Data Frame Rows that do not Match Logical Condition in R (Example)   In this R tutorial you'll learn how to select data frame rows that have no match to a certain condition . The content of the tutorial is structured as follows: So...

### Extract data.table Column as Vector Using Index Position in R (Example)

Extract data.table Column as Vector Using Index Position in R (Example)   This tutorial illustrates how to convert a data.table variable to a vector in the R programming language . Table of contents: Let's jump right to the example...   Example...

### Extract Day from Date in R (Example)

Extract Day from Date in R (Example)   This post explains how to return only the day of a Date object in R programming . Table of contents: Let's take a look at some R codes in action...   Creation of Exemplifying Data...

### Extract Default Color Palette of ggplot2 R Package (Example)

Extract Default Color Palette of ggplot2 R Package (Example)   This tutorial shows how to emulate the ggplot2 default color palette in the R programming language . The content of the page looks as follows: Creation of Example Data...

### Extract Every nth Element of a Vector in R (Example)

Extract Every nth Element of a Vector in R (Example)   On this page you'll learn how to extract every nth element of a vector or column in the R programming language . The content of the tutorial looks as follows: Creation of Example...

### Extract F-Statistic, Number of Predictor Variables/Categories & Degrees of Freedom from Linear Regression Model in R

Extract F-Statistic, Number of Predictor Variables/Categories & Degrees of Freedom from Linear Regression Model in R   In this article you'll learn how to pull out the F-Statistic, the number of predictor variables and categories, as well...

### Extract File & Directory Name from Path in R (2 Examples)

Extract File & Directory Name from Path in R (2 Examples)   In this tutorial, I'll show how to find a file and directory name in a path in the R programming language . The article will consist of the following: Let's dive right...

### Extract First N Rows of Data Frame in R (3 Examples)

Extract First N Rows of Data Frame in R (3 Examples)   This tutorial illustrates how to subset the first N rows of a data frame in the R programming language . The tutorial will contain three examples for the extraction of data rows. To...

### Extract First or Last n Characters from String in R (3 Examples) | Get Leading & Trailing Chars

Extract First or Last n Characters from String in R (3 Examples) | Get Leading & Trailing Chars   In this tutorial, I will explain how to extract n leading or trailing characters from a string in R. I will structure the article as follows: Creation...

### Extract Frequency Counts from Histogram in R (Example)

Extract Frequency Counts from Histogram in R (Example)   This article illustrates how to return the frequencies of a histogram in R programming . Table of contents: Sound good? Let's dive right into the example:   Creation...

### Extract Hours, Minutes & Seconds from Date & Time Object in R (Example)

Extract Hours, Minutes & Seconds from Date & Time Object in R (Example)   In this tutorial, I'll explain how to return only hours, minutes, and seconds from a date/time object in the R programming language . The tutorial will consist of...

### Extract Just Number from Named Numeric Vector in R (3 Examples)

Extract Just Number from Named Numeric Vector in R (3 Examples)   In this tutorial, I'll illustrate how to remove the names from a named vector or array in the R programming language . Table of contents: So now the part you have...

### Extract Month from Date in R (Example)

Extract Month from Date in R (Example)   In this R post you'll learn how to return only the months of a date vector . Table of contents: Let's just jump right in:   Construction of Example Data Have a look at the...

### Extract Most Common Values from Vector in R (Example)

Extract Most Common Values from Vector in R (Example)   In this R tutorial you'll learn how to select the most frequent elements of a vector or data frame variable . Table of contents: Let's dive right into the example!   Creation...

### Extract Multiple & Adjusted R-Squared from Linear Regression Model in R (2 Examples)

Extract Multiple & Adjusted R-Squared from Linear Regression Model in R (2 Examples)   In this tutorial you'll learn how to return multiple and adjusted R-squared in the R programming language . The tutorial is structured as follows: Let's...

### Extract Names of List Elements in R (2 Examples)

Extract Names of List Elements in R (2 Examples)   In this article you'll learn how to return the names of list objects in the R programming language . Table of contents: If you want to learn more about these topics, keep reading.   Creation...

### Extract Numbers from Character String Vector in R (2 Examples)

Extract Numbers from Character String Vector in R (2 Examples)   In this tutorial you'll learn how to return numeric values from a vector of character strings in the R programming language . The post looks as follows: Let's dive...

### Extract Regression Coefficients of Linear Model in R (Example)

Extract Regression Coefficients of Linear Model in R (Example)   This tutorial illustrates how to return the regression coefficients of a linear model estimation in R programming . The content of the tutorial looks like this: So...

### Extract Residuals & Sigma from Linear Regression Model in R (3 Examples)

Extract Residuals & Sigma from Linear Regression Model in R (3 Examples)   This tutorial shows how to return the residuals of a linear regression and descriptive statistics of the residuals in R . Table of contents: With that, let's...

### Extract Row from Data Frame in R (2 Examples)

Extract Row from Data Frame in R (2 Examples)   In this tutorial, I'll illustrate how to return a certain row of a data frame in the R programming language . The article looks as follows: Construction of Example Data Example 1:...

### Extract Significance Stars & Levels from Linear Regression Model in R (Example)

Extract Significance Stars & Levels from Linear Regression Model in R (Example)   In this R tutorial you'll learn how to create a named vector containing significance stars of all linear regression predictors . The tutorial consists of...

### Extract Single Column as Data Frame in R (3 Examples)

Extract Single Column as Data Frame in R (3 Examples)   This tutorial shows how to select a single variable from a data frame and keep the data.frame class in R programming . The post contains three examples for the manipulation of data...

### Extract Single Element from Data Frame in R (2 Examples)

Extract Single Element from Data Frame in R (2 Examples)   In this tutorial, I'll show how to access a particular element of a data frame in R . The content of the article is structured as follows: So without further ado, let's...

### Extract Standard Error, t-Value & p-Value from Linear Regression Model in R (4 Examples)

Extract Standard Error, t-Value & p-Value from Linear Regression Model in R (4 Examples)   This post illustrates how to pull out the standard errors, t-values, and p-values from a linear regression in the R programming language . The article...

### Extract Subset of Data Frame Rows Containing NA in R (2 Examples)

Extract Subset of Data Frame Rows Containing NA in R (2 Examples)   In this article you'll learn how to select rows from a data frame containing missing values in R . The tutorial consists of two examples for the subsetting of data frame...

### Extract Substring Before or After Pattern in R (2 Examples)

Extract Substring Before or After Pattern in R (2 Examples)   In this article you'll learn how to return characters of string in front or after a certain pattern in the R programming language . The content of the page is structured as...

### Extract Unique Values in R (3 Examples)

Extract Unique Values in R (3 Examples)   In this article you'll learn how to select only unique values from a vector or data frame column in the R programming language . The tutorial consists of this: Let's dive right into the...

### Extract Values & Names from table Object in R (2 Examples)

Extract Values & Names from table Object in R (2 Examples)   This article illustrates how to extract the first row and the table names from an object with the table() class in the R programming language . The content of the page is structured...

### Extract Values from Matrix by Column & Row Names in R (3 Examples)

Extract Values from Matrix by Column & Row Names in R (3 Examples)   In this article, I'll show how to get certain column and row values using column and row names of a matrix in the R programming language . The content of the article...

### Extract Year & Month from yearmon Object in R (2 Examples)

Extract Year & Month from yearmon Object in R (2 Examples)   In this tutorial you'll learn how to return only the year and month from a zoo yearmon object in R . The tutorial will consist of two examples for the extraction of years and...

### Extract Year from Date in R (Example)

Extract Year from Date in R (Example)   This tutorial illustrates how to return only the year of an object with class Date in the R programming language . The content of the tutorial is structured as follows: Let's dive right in:   Creation...

### F Distribution in R (4 Examples) | df, pf, qf & rf Functions

F Distribution in R (4 Examples) | df, pf, qf & rf Functions   In this article, I'll illustrate how to apply the F distribution functions in the R programming language . The tutorial will contain this: Example 1: F Density in R (df...

### filter R Function of dplyr Package (Example)

filter R Function of dplyr Package (Example)   This article illustrates how to subset rows by logical conditions with the filter function of the dplyr package in R programming . Table of contents: Creation of Example Data Example:...

### Find & Count Exact Matches in Character String Vector in R (3 Examples)

Find & Count Exact Matches in Character String Vector in R (3 Examples)   This tutorial shows how to identify the index position and how to count exact matches in character strings in the R programming language . Table of contents: Let's...

### Find Common Elements from Multiple Vectors in R (Example)

Find Common Elements from Multiple Vectors in R (Example)   In this article, I'll show how to identify shared elements of multiple vectors in the R programming language . Table of contents: Creating Example Data Example: Find Common...

### Find Common Rows Between Two Data Frames in R (2 Examples)

Find Common Rows Between Two Data Frames in R (2 Examples)   In this tutorial you'll learn how to return all rows that exist in two data frames in the R programming language . The article will contain these contents: Let's take...

### Find Earliest & Latest Date in R (Example)

Find Earliest & Latest Date in R (Example)   In this tutorial you'll learn how to determine the maximum and minimum dates of a vector in the R programming language . The content of the tutorial looks as follows: Let's just jump...

### Find Index of Element in Vector in R (2 Examples)

Find Index of Element in Vector in R (2 Examples)   In this article, I'll show how to find the index of an element in a vector in the R programming language . The tutorial will contain this content: Example Data Example 1: Find...

### Find Index of Maximum & Minimum Value of Vector & Data Frame Row in R (2 Examples)

Find Index of Maximum & Minimum Value of Vector & Data Frame Row in R (2 Examples)   In this article you'll learn how to identify the index of maxima and minima of vectors and data frames in the R programming language . The tutorial will...

### Find Index Position of First Non-NA Value in R (Example)

Find Index Position of First Non-NA Value in R (Example)   This post explains how to get the position of the first non-NA value in a vector in R . Table of contents: You're here for the answer, so let's get straight to the example:   Construction...

### Find Max & Min Length of Character Strings in Columns in R (4 Examples)

Find Max & Min Length of Character Strings in Columns in R (4 Examples)   In this article, I'll show how to get the number of characters in in each string data frame variables in the R programming language . Table of contents: Let's...

### Find Out Which Package Version is Loaded in R (Example Code)

Find Out Which Package Version is Loaded in R (Example Code)   The following R programming syntax illustrates how to find out the package version which is currently loaded in R . For this tutorial, I'm going to use the dplyr package . Let's...

### Find Position of Character in String in R (3 Examples) | Identify Location

Find Position of Character in String in R (3 Examples) | Identify Location   In this R tutorial you'll learn how to identify the location of a character in a string . The article consists of these content blocks: Let's dig in:   Creation...

### Find Rows in First Data Frame that are not in Second in R (Example)

Find Rows in First Data Frame that are not in Second in R (Example)   In this R tutorial you'll learn how to identify rows that are only in the first data frame, but not in the second data frame . The article will contain this information: You're...

### Find Transparent Equivalent of Color in R (2 Examples)

Find Transparent Equivalent of Color in R (2 Examples)   This page shows how to determine the transparent version of a hex color code in the R programming language . The post contains these content blocks: Here's how to do it:   Example...

### Find Unique Combinations of All Elements from Two Vectors in R (2 Examples)

Find Unique Combinations of All Elements from Two Vectors in R (2 Examples)   In this tutorial, I'll explain how to find unique combinations of two vectors or arrays in the R programming language . The article will consist of the following...

### Find Unique Values in List in R (Example)

Find Unique Values in List in R (Example)   In this tutorial you'll learn how to get all unique elements of a list in the R programming language . The article consists of one example for the identification of unique values. To be more...

### Find Values Contained in First Vector but not Another in R (2 Examples)

Find Values Contained in First Vector but not Another in R (2 Examples)   In this R programming post you'll learn how to find out which values are contained in one vector, but not in a second vector . The article will consist of two examples...

### Fit Smooth Curve to Plot of Data in R (Example)

Fit Smooth Curve to Plot of Data in R (Example)   In this tutorial you'll learn how to draw a smooth line to a scatterplot in the R programming language . Table of contents: Here's how to do it:   Introduction of Example...

### Fitting Polynomial Regression Model in R (3 Examples)

Fitting Polynomial Regression Model in R (3 Examples)   In this post, I'll explain how to estimate a polynomial regression model in the R programming language . The article is structured as follows: Let's dive right in!   Creation...

### Fix Aspect Ratio in ggplot2 Plot in R (2 Examples)

Fix Aspect Ratio in ggplot2 Plot in R (2 Examples)   In this R tutorial you'll learn how to use the coord_fixed function to set a fixed aspect ratio . The table of content is structured as follows: Let's jump right to the examples:   Exemplifying...

### Fix R Error: '\U' used without hex digits in character string starting ""C:\U"

Fix R Error: '\U' used without hex digits in character string starting ""C:\U"   In this post, I'll explain how to handle the error message 'U' used without hex digits in character string starting ""C:U" in Windows in the R programming language...

### for-Loop in R (10 Examples) | Writing, Running & Using Loops in RStudio

for-Loop in R (10 Examples) | Writing, Running & Using Loops in RStudio   This post explains how to write and run for-loops in the R programming language . The post will contain these content blocks: Before we dive into the examples,...

### for-Loop Index in R (2 Examples)

for-Loop Index in R (2 Examples)   In this R tutorial you'll learn how to use for-loop indices . Table of contents: Let's start right away:   Example 1: Print for-Loop Index to Console This Example explains how to...

### for-Loop Only Returns Last Value in R (2 Examples)

for-Loop Only Returns Last Value in R (2 Examples)   In this tutorial, I'll illustrate how to return not only the last value of a for-loop in the R programming language . The post consists of this content: You're here for the answer,...

### for-Loop with Increments in R (Example) | Increment by Size / Step 2

for-Loop with Increments in R (Example) | Increment by Size / Step 2   In this R programming tutorial you'll learn how to write for-loops with increments by 2 . The post looks as follows: It's time to dive into the example:   Example:...

### for-Loop with Range in R (Example)

for-Loop with Range in R (Example)   This article explains how to write a for-loop with range in the R programming language . The tutorial looks as follows: Here's the step-by-step process.   Example: Looping Over Range...

### Force Plot Axes to Start at Zero in R (2 Examples)

Force Plot Axes to Start at Zero in R (2 Examples)   In this R tutorial you'll learn how to set the start of x- and y-axes to zero . The content looks as follows: So now the part you have been waiting for - the examples:   Creation...

### Force R to Show Scientific Notation (2 Examples)

Force R to Show Scientific Notation (2 Examples)   In this tutorial you'll learn how to show numbers in scientific notation (e.g. 12e-7) in R programming . The page will contain these topics: Let's get started.   Creating...

### format Function in R (2 Examples)

format Function in R (2 Examples)   This article shows how to encode data objects in a common format using the format() function in the R programming language . Table of contents: So now the part you have been waiting for - the...

### Format Number as Percentage in R (3 Examples) | Express Numeric Values in Percent

Format Number as Percentage in R (3 Examples) | Express Numeric Values in Percent   On this page, I'll explain how to express numeric values in percent in the R programming language . The post is structured as follows: Creating Example...

### Format Number of Decimal Places in R (2 Example Codes)

Format Number of Decimal Places in R (2 Example Codes)   This tutorial explains how to control the number of decimal places within the R programming language . The table of contents looks as follows: Creating Example Data Control...

### Gamma Distribution in R (4 Examples) | dgamma, pgamma, qgamma & rgamma Functions

Gamma Distribution in R (4 Examples) | dgamma, pgamma, qgamma & rgamma Functions   This article illustrates how to apply the gamma functions in the R programming language . The post is structured as follows: Example 1: Gamma Density...

### Geometric Distribution in R (4 Examples) | dgeom, pgeom, qgeom & rgeom Functions

Geometric Distribution in R (4 Examples) | dgeom, pgeom, qgeom & rgeom Functions   This tutorial shows how to apply the geometric functions in the R programming language . The tutorial contains four examples for the geom R commands. More...

### Geometric Mean in R (2 Examples)

Geometric Mean in R (2 Examples)   This post explains how to compute the geometric mean in the R programming language . This article contains two examples including reproducible R codes. So without further ado, let's move on to the...

### Geospatial Distance Between Two Points in R (Example)

Geospatial Distance Between Two Points in R (Example)   In this article, I'll illustrate how to calculate different types of geographical distance metrics in the R programming language . The page looks as follows: Here's the step-by-step...

### Get & Set Directory Path of Installed Packages Using libPaths Function in R (3 Examples)

Get & Set Directory Path of Installed Packages Using libPaths Function in R (3 Examples)   This tutorial shows how to get and set the directory path of libraries in R programming . The tutorial consists of the following content blocks: Here's...

### Get & Set Working Directory in R (3 Examples) | getwd & setwd Functions

Get & Set Working Directory in R (3 Examples) | getwd & setwd Functions   This tutorial explains how to identify and change working directories using the getwd and setwd functions in the R programming language . Table of contents: So...

### Get All Factor Levels of Vector & Data Frame Column in R (2 Examples)

Get All Factor Levels of Vector & Data Frame Column in R (2 Examples)   In this article you'll learn how to return all levels of a factor object in the R programming language . Table of contents: It's time to dive into the examples!   Example...

### Get Column Index in Data Frame by Variable Name in R (2 Examples)

Get Column Index in Data Frame by Variable Name in R (2 Examples)   In this tutorial, I'll illustrate how to find the index of a column in a data frame in the R programming language . Table of contents: You're here for the answer,...

### Get Frequency of Elements with Certain Value in Vector (2 R Programming Examples)

Get Frequency of Elements with Certain Value in Vector (2 R Programming Examples)   In this tutorial, I'll explain how to count the number of elements with a certain value in the R programming language . I will show you two programming...

### Get Last Value of Vector in R (2 Examples)

Get Last Value of Vector in R (2 Examples)   In this R tutorial you'll learn how to access the last value in a vector . The article is structured as follows: Creation of Example Data Access Last Value with length Function Access...

### Get Row Index Number in R (Example) | Find Indices in Data Frame

Get Row Index Number in R (Example) | Find Indices in Data Frame   In this tutorial you'll learn how to return the referencing row index number in the R programming language . The post consists of these content blocks: So let's...

### Get Row Indices where Data Frame Column has a Particular Value in R (2 Examples)

Get Row Indices where Data Frame Column has a Particular Value in R (2 Examples)   In this article you'll learn how to return the row indices of rows with a specific column value in the R programming language . Table of contents: Let's...

### Get Second Lowest & Highest Value in R (2 Examples)

Get Second Lowest & Highest Value in R (2 Examples)   This article explains how to find the second (and third...) lowest / highest values of a vector or data frame column in R . The content of the tutorial looks as follows: Let's...

### Get Second Sub Entry of Every List Element in R (Example)

Get Second Sub Entry of Every List Element in R (Example)   This article illustrates how to extract the second entry of every list element in the R programming language . Table of contents: Let's dive into it!   Creation...

### Get Sum of Data Frame Column Values in R (2 Examples)

Get Sum of Data Frame Column Values in R (2 Examples)   In this article you'll learn how to compute the sum of one or all columns of a data frame in the R programming language . Table of contents: Let's do this:   Introducing...

### Get Value of Data Element without Name or Index in R (3 Examples)

Get Value of Data Element without Name or Index in R (3 Examples)   This tutorial explains how to return only the value of a data table element without showing the name or index in the R programming language . The tutorial contains these...

### Get Week Number of Date in R (2 Examples)

Get Week Number of Date in R (2 Examples)   In this R programming tutorial you'll learn how to extract the week number from a date object . The tutorial consists of these topics: Let's take a look at some R codes in action.   Creation...

### GGally Package in R | Tutorial & Programming Examples

GGally Package in R | Tutorial & Programming Examples   The GGally R package is an extension of the ggplot2 package and adds several additional functions for the plotting of data in R. Here you can find the CRAN page of the GGally package....

### ggplot2 Barplot with Axis Break & Zoom in R (2 Examples)

ggplot2 Barplot with Axis Break & Zoom in R (2 Examples)   In this R tutorial you'll learn how to create a ggplot2 barchart with axis break and zoom . The tutorial will contain the following contents: Let's get started:   Example...

### ggplot2 Error in R: "`data` must be a data frame, or other object coercible by `fortify()`, not an integer vector"

ggplot2 Error in R: "`data` must be a data frame, or other object coercible by `fortify()`, not an integer vector"   This article explains how to deal with the ggplot2 error message "`data` must be a data frame, or other object coercible by...

### ggplot2 Error in R: Cannot use `+.gg()` with a single argument - new line?

ggplot2 Error in R: Cannot use `+.gg()` with a single argument - new line?   In this R tutorial you'll learn how to deal with the error "Cannot use `+.gg()` with a single argument" . The tutorial consists of this information: Let's...

### ggplot2 Error in R: Must be Data Frame not S3 Object with Class Uneval

ggplot2 Error in R: Must be Data Frame not S3 Object with Class Uneval   In this article you'll learn how to handle the ggplot2 error message "data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class...

### ggplot2 Plot in Script is not Displayed in R (Example)

ggplot2 Plot in Script is not Displayed in R (Example)   This tutorial shows how to show a ggplot2 graphic when running a script in the R programming language . The tutorial consists of the following content blocks: So without further...

### ggplot2 Plot with Transparent Background in R (2 Examples)

ggplot2 Plot with Transparent Background in R (2 Examples)   In this post, I'll illustrate how to export a ggplot2 graph with transparent background in R programming . The tutorial consists of the following information: Here's the...

### ggplot2 Title & Subtitle with Different Size and Color in R (2 Examples)

ggplot2 Title & Subtitle with Different Size and Color in R (2 Examples)   This article illustrates how to modify text sizes and colors of title and subtitle of a ggplot2 plot in R . The content is structured as follows: Sound good?...

### ggplot2 Warning - geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?

ggplot2 Warning - geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?   In this article you'll learn how to handle the warning message "geom_path: Each group consists of only one observation....

### glm.fit Warning Messages in R: algorithm didn't converge & probabilities 0/1

glm.fit Warning Messages in R: algorithm didn't converge & probabilities 0/1   In this R tutorial you'll learn how to handle the glm.fit warning: "algorithm did not converge and fitted probabilities numerically 0 or 1" . The article is...

### Graphics in R (Gallery with Examples)

Graphics in R (Gallery with Examples)   This page shows an overview of (almost all) different types of graphics, plots, charts, diagrams, and figures of the R programming language . Here is a list of all graph types that are illustrated...

### grep & grepl R Functions (3 Examples) | Match One or Multiple Patterns in Character String

grep & grepl R Functions (3 Examples) | Match One or Multiple Patterns in Character String   This tutorial explains how to search for matches of certain character pattern in the R programming language. The article is mainly based on the...

### Group Data Frame by Multiple Columns in R (Example)

Group Data Frame by Multiple Columns in R (Example)   This article explains how to group a data frame based on two variables in R programming . The article is structured as follows: Here's the step-by-step process:   Construction...

### Group data.table by Multiple Columns in R (Example)

Group data.table by Multiple Columns in R (Example)   This tutorial illustrates how to group a data table based on multiple variables in R programming . Table of contents: Let's dig in:   Example Data & Add-On Packages...

### Group Factor Levels in R (Example)

Group Factor Levels in R (Example)   In this R tutorial you'll learn how to regroup factor levels of a factor vector or column . The tutorial consists of this information: You're here for the answer, so let's get straight to the...

### Handling '+' Sign in R Prompt / RStudio Console

Handling '+' Sign in R Prompt / RStudio Console   In this R tutorial you'll learn how to deal with a + sign in the RStudio console . The post consists of two examples for the handling of + signs in the prompt. To be more specific, the...

### Handling Errors & Warnings in R | List of Typical Messages & How to Solve

Handling Errors & Warnings in R | List of Typical Messages & How to Solve     List of Typical Errors & Warnings in R (+ Examples) [ reached getOption("max.print") -- omitted X entries ] Don't know how to automatically...

### Harmonic Mean in R (2 Examples)

Harmonic Mean in R (2 Examples)   This page shows how to compute the harmonic mean in the R programming language . I will show based on two reproducible examples how to calculate the harmonic mean for a numeric vector or a data frame...

### Haversine Great Circle Distance in R (Example)

Haversine Great Circle Distance in R (Example)   This post explains how to calculate the Haversine distance in the R programming language . Table of contents: Let's dig in:   Creation of Example Data In the first...

### How to Add New Elements to a List in R (Example)

How to Add New Elements to a List in R (Example)   In this R programming tutorial you'll learn how to append new elements to a list . The post will contain the following topics: Creation of Exemplifying Data Example: Appending...

### How to Apply a Function to Each Element of a Matrix in R (2 Examples)

How to Apply a Function to Each Element of a Matrix in R (2 Examples)   This page explains how to apply a function or command to all matrix elements in the R programming language . The table of content looks as follows: Let's take...

### How to Catch an integer(0) in R (2 Examples)

How to Catch an integer(0) in R (2 Examples)   In this R post you'll learn how to identify an integer of length zero . The page contains the following topics: So let's just jump right in!   Example Data Consider the...

### How to cbind & rbind Vectors with Different Length in R (2 Examples)

How to cbind & rbind Vectors with Different Length in R (2 Examples)   In this article, I'll show how to merge multiple vector objects with different length in R programming . The page will contain two examples for the merging of data....

### How to Combine Lists in R (2 Examples)

How to Combine Lists in R (2 Examples)   This article shows how to append two lists in the R programming language . The content of the page looks as follows: Construction of Example Data Example: Append Two Lists in R with c()...

### How to Compute Euler's Number in R (Example)

How to Compute Euler's Number in R (Example)   In this article, I'll illustrate how to get Euler's number' in the R programming language . The tutorial consists of this content: Let's dive into it.   Example: Computing...

### How to Compute Summary Statistics by Group in R (3 Examples)

How to Compute Summary Statistics by Group in R (3 Examples)   This page shows how to calculate descriptive statistics by group in R . The article contains the following topics: If you want to know more about these topics, keep...

### How to Convert a Character to Numeric in R

How to Convert a Character to Numeric in R   Basic R Syntax: x_num

### How to Convert a Factor to Numeric in R

How to Convert a Factor to Numeric in R   Basic R Syntax: x_num

### How to Create a Range of Dates in R (Example)

How to Create a Range of Dates in R (Example)   In this post you'll learn how to generate a date range in R programming . The page contains these contents: Example: Generating a Range of Dates in R Video & Further Resources ...

### How to Create a Vector of Zero Length in R (Example)

How to Create a Vector of Zero Length in R (Example)   In this post, I'll explain how to create an empty vector in R programming . Table of contents: Example 1: Create Empty Numeric Vector in R Example 2: Empty Vectors of Other...

### How to Create a Vector of Zeros in R (5 Examples)

How to Create a Vector of Zeros in R (5 Examples)   In this R tutorial you'll learn how to declare a vector or array containing only zeros . The article will contain these topics: Let's get started.   Example 1: Creating...

### How to Create a Venn Diagram in R (8 Examples)

How to Create a Venn Diagram in R (8 Examples)   This article illustrates how to draw venn diagrams in the R programming language . Venn diagrams are also referred to as primary diagram, set diagram, or logic diagram. Table of contents: Setting...

### How to Create an Empty Plot in R (2 Examples)

How to Create an Empty Plot in R (2 Examples)   In this R tutorial you'll learn how to draw an empty plot . The article will contain this information: Example 1: Draw Empty Plot with plot.new Function Example 2: Manually Remove...

### How to Delete a File Using R (Example)

How to Delete a File Using R (Example)   This article illustrates how to apply the file.remove function to delete files in R programming . Table of contents: Let's get started:   Example Directory & File In this tutorial,...

### How to Draw a Horizontal Barplot in R (2 Examples)

How to Draw a Horizontal Barplot in R (2 Examples)   This post explains how to create a barchart with horizontal bars in the R programming language . The tutorial contains these topics: Let's dive into it.   Example Data...

### How to Extract the Intercept from a Linear Regression Model in R (Example)

How to Extract the Intercept from a Linear Regression Model in R (Example)   In this R article you'll learn how to return the intercept of a linear regression model . Table of contents: So without further ado, let's dive into it.   Creation...

### How to Filter a Vector in R (Example)

How to Filter a Vector in R (Example)   In this post you'll learn how to subset the elements of a vector object in the R programming language . Table of contents: It's time to dive into the example:   Construction of...

### How to Fix in R: Error in file(file, "rt") : cannot open the connection

How to Fix in R: Error in file(file, "rt") : cannot open the connection   In this tutorial you'll learn how to fix the message "Error in file(file, "rt") : cannot open the connection" in the R programming language . The page looks as follows: If...

### How to Fix the R Error in stripchart.default(x1, ...) : invalid plotting method

How to Fix the R Error in stripchart.default(x1, ...) : invalid plotting method   This article explains how to get rid of the "Error in stripchart.default(x1, ...) : invalid plotting method" in R . The tutorial contains the following: Let's...

### How to Fix the R Error: bad restore file magic number (file may be corrupted) -- no data loaded

How to Fix the R Error: bad restore file magic number (file may be corrupted) -- no data loaded   In this tutorial you'll learn how to deal with the error message "bad restore file magic number (file may be corrupted) -- no data loaded" in...

### How to Rename a Column Name in R | 3 Examples to Change Colnames of a Data Frame

How to Rename a Column Name in R | 3 Examples to Change Colnames of a Data Frame   Basic R Syntax: # Change colname of one column colnames(data)[colnames(data) == "Old_Name"]

### How to Save a Data Frame in R (Example)

How to Save a Data Frame in R (Example)   In this article, I'll show how to save a data frame in R programming . Table of contents: Introduction of Example Data Example: Save Data Frame in R Video, Further Resources & Summary...

### How to Set Column Names within the aggregate Function in R (2 Examples)

How to Set Column Names within the aggregate Function in R (2 Examples)   This article explains how to change the variable names of an aggregated data frame in the R programming language . The post contains this content: Let's dive...

### How to Split a Date-Time Column into Separate Variables in R (Example)

How to Split a Date-Time Column into Separate Variables in R (Example)   This tutorial illustrates how to divide a date-time object into two different variables in R programming . The tutorial will consist of one example for the splitting...

### How to Use R to Download File from Internet (Example)

How to Use R to Download File from Internet (Example)   In this article, I'll explain how to use the R programming language to download a file from the internet. Let's dive right in!   Step 1: Get URL of File First, we...

### Hypergeometric Distribution in R (4 Examples) | dhyper, phyper, qhyper & rhyper Functions

Hypergeometric Distribution in R (4 Examples) | dhyper, phyper, qhyper & rhyper Functions   This article explains how to use the hypergeometric functions in the R programming language . The post is structured as follows: Example 1:...

### If Else Statement in R (4 Examples)

If Else Statement in R (4 Examples)   In this R tutorial you'll learn how to use different types of if and else statements . The article looks as follows: Let's dive right into the exemplifying R code!   Example 1: Applying...

### if_else R Function of dplyr Package (2 Examples)

if_else R Function of dplyr Package (2 Examples)   In this tutorial you'll learn how to apply the if_else function of the dplyr package in R programming . Table of contents: Example 1: Basic Application of if_else Function Example...

### Ignore Outliers in ggplot2 Boxplot in R (Example)

Ignore Outliers in ggplot2 Boxplot in R (Example)   In this article you'll learn how to remove outliers from ggplot2 boxplots in the R programming language . The article will contain one examples for the removal of outliers . To be more...

### Import & Merge Multiple csv Files in R (Example)

Import & Merge Multiple csv Files in R (Example)   In this article, I'll show you how to import and merge csv files in the R programming language . The page will contain the following topics: Exemplifying Data Import & Load csv...

### Import Text File as Single Character String in R (Example)

Import Text File as Single Character String in R (Example)   In this R tutorial you'll learn how to read a TXT file as a single character string . The tutorial will consist of this information: Let's dive into it:   Creating...

### Increase Font Size in Base R Plot (5 Examples)

Increase Font Size in Base R Plot (5 Examples)   In this article you'll learn how to increase font sizes in a plot in the R programming language . The page contains these contents: Creation of Example Data Example 1: Increase Font...

### Increase Space Between ggplot2 Facet Plot Panels in R (Example)

Increase Space Between ggplot2 Facet Plot Panels in R (Example)   In this tutorial you'll learn how to add additional space between the panels of a ggplot2 facet grid plot in the R programming language . Table of contents: It's...

### Increase Y-Axis Scale of Barplot in R (2 Examples)

Increase Y-Axis Scale of Barplot in R (2 Examples)   This tutorial illustrates how to adjust the range of barchart ylim values in the R programming language . The tutorial will consist of these contents: If you want to learn more...

### Index Element of List in R (3 Examples)

Index Element of List in R (3 Examples)   This tutorial shows how to return certain list elements using indices in the R programming language . Table of contents: Let's dive into it!   Creation of Example Data The...

### Indexing Up to the End of Vector & Data Frame in R (2 Examples)

Indexing Up to the End of Vector & Data Frame in R (2 Examples)   In this article you'll learn how to return the end of a vector or data frame in R programming . Table of contents: Let's take a look at some R codes in action...   Example...

### Insert Character Pattern at Particular Position of String in R (2 Examples)

Insert Character Pattern at Particular Position of String in R (2 Examples)   On this page, I'll show how to insert a character pattern at a particular position of a string in the R programming language . Table of contents: Let's...

### Insert New Column Between Two Data Frame Variables in R (2 Examples)

Insert New Column Between Two Data Frame Variables in R (2 Examples)   This article shows how to add new variables at a specific position of a data frame in the R programming language . The tutorial is structured as follows: Let's...

### Insert Rows for Missing Dates in R (Example)

Insert Rows for Missing Dates in R (Example)   In this post you'll learn how to add new rows in case a date is missing in R . The tutorial will contain one example for the addition of new rows. More precisely, the post will consist of...

### Integrate Function in R (Example) | Using integrate() to Compute Integral

Integrate Function in R (Example) | Using integrate() to Compute Integral   This tutorial illustrates how to integrate a user-defined function using integrate() in R . Table of contents: Let's do this...   Constructing...

### Introduction to ggpattern Package in R (6 Examples) | ggplot2 Plots with Textures

Introduction to ggpattern Package in R (6 Examples) | ggplot2 Plots with Textures   This tutorial explains how to draw ggplot2 plots with textures and patterns using the ggpattern package in R programming . Table of contents: Let's...

### Introduction to ggvenn Package in R (4 Examples)

Introduction to ggvenn Package in R (4 Examples)   On this page you'll learn how to create venn diagrams using the ggvenn package in R programming . The article will consist of these contents: Let's just jump right in!   Basic...

### Introduction to the pacman Package in R (3 Examples)

Introduction to the pacman Package in R (3 Examples)   In this R tutorial you'll learn how to use the functions of the pacman add-on package . The content of the post is structured as follows: Let's get started!   Basic...

### Introduction to the patchwork Package in R (Example Codes)

Introduction to the patchwork Package in R (Example Codes)   Recently, I have discovered the patchwork package of Thomas Lin Pedersen and I was impressed how easy it is to combine multiple ggplot2 plots in a plot composition using this package. In...

### Inverse of Matrix in R (Example)

Inverse of Matrix in R (Example)   In this tutorial, I'll show how to invert a matrix in R . The article consists of this: Let's dive right into the examples...   Creating Example Data First, we need to create an...

### IQR Function in R (2 Examples) | How to Compute the Interquartile Range

IQR Function in R (2 Examples) | How to Compute the Interquartile Range   This article explains how to compute an Interquartile Range (IQR) in the R programming language . The tutorial is mainly based on the IQR() R function. So let's...

### Join Data Frames with the R dplyr Package (9 Examples)

Join Data Frames with the R dplyr Package (9 Examples)   In this R programming tutorial, I will show you how to merge data with the join functions of the dplyr package . More precisely, I'm going to explain the following functions: inner_join...

### Keep Original Row Order when Merging Data (Example)

Keep Original Row Order when Merging Data (Example)   On this page, I'll show how to retain the order of the rows of the first input data frame when merging data in R programming . The tutorial will contain one example for the combination...

### Keep Unused Factor Levels in ggplot2 Barplot in R (Example)

Keep Unused Factor Levels in ggplot2 Barplot in R (Example)   This tutorial shows how to draw a ggplot2 barplot containing empty factor levels in R programming . The content of the tutorial is structured like this: With that, let's...

### Law of Cosines Great Circle Distance in R (Example)

Law of Cosines Great Circle Distance in R (Example)   In this R tutorial you'll learn how to calculate the Law of Cosines distance . The content looks as follows: It's time to dive into the programming part:   Exemplifying...

### layout Function in R (3 Examples) | Arrange Grid of Plots in Base R

layout Function in R (3 Examples) | Arrange Grid of Plots in Base R   This tutorial illustrates how to specify a graphic layout using the layout() function in the R programming language . Table of contents: It's time to dive into...

### lead & lag R Functions of dplyr Package (2 Examples)

lead & lag R Functions of dplyr Package (2 Examples)   This tutorial shows how to apply the lead and lag functions of the dplyr add-on package in the R programming language . Table of contents: Example Data Example 1: Basic Application...

### Left-Align Text in ggplot2 Plot in R (Example)

Left-Align Text in ggplot2 Plot in R (Example)   In this article you'll learn how to align text in a ggplot2 graphic on the left side of the plot in R . Table of contents: It's time to dive into the example:   Example...

### List All Column Names But One in R (2 Examples)

List All Column Names But One in R (2 Examples)   This tutorial illustrates how to get a list of all variable names except one in the R programming language . The tutorial contains this content: You're here for the answer, so let's...

### List All Files with Specific Extension in R (Example) | list.files Function

List All Files with Specific Extension in R (Example) | list.files Function   In this tutorial, I'll illustrate how to return a list with all file names of a directory containing a certain pattern in R programming . The content looks as...

### List Error in R - attempt to select less than one element in get1index real

List Error in R - attempt to select less than one element in get1index real   In this tutorial you'll learn how to reproduce and handle the error message "attempt to select less than one element in get1index real" in R programming . The...

### List of Useful R Packages

List of Useful R Packages   The R programming language provides a huge list of different R packages , containing many tools and functions for statistics and data science. This page shows a list of useful R packages and libraries. By clicking...

### Load Multiple Packages at Once in R (Example)

Load Multiple Packages at Once in R (Example)   In this tutorial, I'll illustrate how to load several add-on packages with one line of code in the R programming language . The article consists of these content blocks: Creation of Example...

### Locate & Extract Regular Expression Match in R (2 Examples)

Locate & Extract Regular Expression Match in R (2 Examples)   On this page you'll learn how to locate and return a regular expression match in R . The tutorial will contain this information: Here's the step-by-step process!   Creating...

### log Function in R (5 Examples) | Natural, Binary & Common Logarithm

log Function in R (5 Examples) | Natural, Binary & Common Logarithm   This post shows how to compute logarithms using the log function in the R programming language . Table of contents: You're here for the answer, so let's get straight...

### Log Normal Distribution in R (4 Examples) | dlnorm, plnorm, qlnorm & rlnorm Functions

Log Normal Distribution in R (4 Examples) | dlnorm, plnorm, qlnorm & rlnorm Functions   This tutorial shows how to apply the log normal functions in R . The page consists of this content: Example 1: Log Normal Probability Density...

### Logistic Distribution in R (4 Examples) | dlogis, plogis, qlogis & rlogis Functions

Logistic Distribution in R (4 Examples) | dlogis, plogis, qlogis & rlogis Functions   In this R tutorial you'll learn how to apply the logistic functions . The article contains this information: Example 1: Logistic Density in R (dlogis...

### Loop Through List in R (Example) | while- & for-Loop Over Lists

Loop Through List in R (Example) | while- & for-Loop Over Lists   In this R programming tutorial you'll learn how to run a for-loop to loop through a list object . The tutorial looks as follows: Let's start right away:   Introduction...

### Loop Through Vector in R (Example) | Run while- & for-Loops Over Vectors

Loop Through Vector in R (Example) | Run while- & for-Loops Over Vectors   This tutorial shows how to loop over the elements of a vector object in R programming . The post looks as follows: Let's get started.   Example...

### Loop with Character Vector in R (Example)

Loop with Character Vector in R (Example)   In this tutorial you'll learn how to loop through a character string vector in R programming . The article consists of the following information: It's time to dive into the example.   Introducing...

### Loop with Multiple Conditions in R (2 Examples) | while- & for-Loops

Loop with Multiple Conditions in R (2 Examples) | while- & for-Loops   In this tutorial, I'll show how to write and run loops with multiple conditions in the R programming language . Table of contents: Let's dig in:   Example...

### Loops in R (Examples) | How to Write, Run & Use a Loop in RStudio

Loops in R (Examples) | How to Write, Run & Use a Loop in RStudio   Loops are among the most powerful tools of the R programming language (and programming in general). In this tutorial I want to give a brief introduction to loops in...

### lowess() R Smoothing Function | 2 Example Codes for Normalization by Lowess Regression

lowess() R Smoothing Function | 2 Example Codes for Normalization by Lowess Regression   Basic R Syntax: lowess_values

### match Function in R (4 Example Codes)

match Function in R (4 Example Codes)   This tutorial shows how to search for matches between two data objects in the R programming language. The article is mainly based on the match() R function . The basic R syntax and the definition...

### Match Wildcard Pattern and Character String in R (Example)

Match Wildcard Pattern and Character String in R (Example)   On this page, I'll illustrate how to match wildcard patterns and character strings in the R programming language . The tutorial will contain these contents: So now the...

### Matrix Multiplication Error in R: non-conformable arguments (2 Examples)

Matrix Multiplication Error in R: non-conformable arguments (2 Examples)   In this article, I'll illustrate how to deal with the error message "non-conformable arguments" in R when performing matrix multiplication . Table of contents: Let's...

### matrixStats Package in R | Tutorial & Programming Examples

matrixStats Package in R | Tutorial & Programming Examples   The matrixStats R package provides high-performing tools for operating on rows and columns of data matrices. Here you can find the documentation of the matrixStats package....

### Mean by Group in R (2 Examples) | dplyr Package vs. Base R

Mean by Group in R (2 Examples) | dplyr Package vs. Base R   In this tutorial you'll learn how to compute the mean by group in the R programming language . I'll show two different alternatives including reproducible R codes. Let's...

### mean Function in R (4 Examples)

mean Function in R (4 Examples)   In this article you'll learn how to compute the mean in R . The tutorial is mainly based on the mean() function. Let's have a look at the basic R syntax and the definition of the mean function first:   Basic...

### Meaning of \$ Operator in R (2 Examples)

Meaning of \$ Operator in R (2 Examples)   In this tutorial you'll learn how to use the \$ operator in the R programming language . The content of the page is structured as follows: Let's start right away!   Example 1:...

### Measuring Execution Time of Function in R (Example Code)

Measuring Execution Time of Function in R (Example Code)   In this tutorial, I'll illustrate how to check the execution time of a function in R programming . The tutorial will contain the following information: Example: Measuring Function...

### Median Absolute Deviation in R (Example) | mad Function Explained

Median Absolute Deviation in R (Example) | mad Function Explained   In this article, I'll explain how to compute the median absolute deviation in the R programming language . The tutorial is mainly relying on the mad R function . The basic...

### Median in R (5 Examples)

Median in R (5 Examples)   This tutorial shows how to compute the median in R . The article is mainly based on the median() function. So let's have a look at the basic R syntax and the definition of the median function first:   Basic...

### Meeus Great Circle Distance in R (Example)

Meeus Great Circle Distance in R (Example)   In this post, I'll illustrate how to compute the Meeus distance in R programming . Table of contents: Let's get started.   Creation of Example Data The following data will...

### Merge Data Frames by Column Names in R (3 Examples)

Merge Data Frames by Column Names in R (3 Examples)   In this R post you'll learn how to merge data frames by column names . The tutorial consists of three examples for the merging of different data sets. More precisely, the article consists...

### Merge Data Frames by Row Names in R (Example)

Merge Data Frames by Row Names in R (Example)   In this R programming article you'll learn how to merge data frames by row names . The content of the post is structured as follows: Constructing Example Data Merge Data Frames by...

### Merge Data Frames by Two ID Columns in R (2 Examples)

Merge Data Frames by Two ID Columns in R (2 Examples)   In this article you'll learn how to combine multiple data frames based on more than one ID column in R . The article looks as follows: Let's take a look at some R codes in...

### Merge Time Series in R (Example)

Merge Time Series in R (Example)   In this R tutorial, I'll explain how to merge two time series objects in the R programming language . The tutorial will contain the following contents: Example Data Merge Time Series in R Video...

### Merge Two data.table Objects in R (Example)

Merge Two data.table Objects in R (Example)   In this tutorial you'll learn how to combine two data.table objects in the R programming language . Table of contents: Let's get started...   Example Data & Add-On Packages...

### Merge Two Lists in R (Example)

Merge Two Lists in R (Example)   This page shows how to merge two lists in the R programming language . Note that this article aims to merge two lists (i.e. if the elements of both lists have the same name the two elements will be combined)....

### Merge Two Matrices by Columns in R (2 Examples)

Merge Two Matrices by Columns in R (2 Examples)   In this tutorial you'll learn how to merge the columns of two matrices in R . The tutorial will contain this: Sound good? Let's get started:   Exemplifying Data We'll...

### Merge Two Unequal Data Frames & Replace NA with 0 in R (Example)

Merge Two Unequal Data Frames & Replace NA with 0 in R (Example)   In this tutorial, I'll show how to join two unequal data frames and replace missing values by zero in R . The page will consist of the following topics: It's time...

### message() vs. warning() vs. stop() Functions in R (4 Examples)

message() vs. warning() vs. stop() Functions in R (4 Examples)   This article shows how to return warning and error messages in the R programming language . The article will contain four examples for the application of the message, warning,...

### Mode in R (4 Programming Examples)

Mode in R (4 Programming Examples)   In this tutorial, I'll explain how to compute the mode in R . The article contains four examples for different data scenarios. So without further ado, let's jump right to the examples.   Example...

### Modify Major & Minor Grid Lines of ggplot2 Plot in R (5 Examples)

Modify Major & Minor Grid Lines of ggplot2 Plot in R (5 Examples)   This post shows how to control the grid lines of a ggplot2 graph in the R programming language . Table of contents: So now the part you have been waiting for -...

### Modify Numbers with Comma as Thousand Separator in R (2 Examples)

Modify Numbers with Comma as Thousand Separator in R (2 Examples)   This tutorial illustrates how to change thousand separators from comma to point in the R programming language . Table of contents: Let's just jump right in...   Example...

### Move Axis Label Closer to Plot in Base R (2 Examples)

Move Axis Label Closer to Plot in Base R (2 Examples)   In this R tutorial you'll learn how to decrease (or increase) the space between the axis label text and the axes . The tutorial will consist of two examples for the modification of...

### Move Column to First Position of Data Frame in R (2 Examples)

Move Column to First Position of Data Frame in R (2 Examples)   In this R programming tutorial you'll learn how to shift a variable to the beginning of a data frame . The tutorial consists of these contents: So now the part you...

### Move Position of Barplot Legend in R (Example)

Move Position of Barplot Legend in R (Example)   In this article you'll learn how to change the location of a barchart legend in the R programming language . The tutorial contains this: Here's how to do it!   Constructing...

### Move Position of ggplot2 Legend in R (4 Examples)

Move Position of ggplot2 Legend in R (4 Examples)   In this article you'll learn how to change the position of ggplot2 legends in the R programming language . Table of contents: You're here for the answer, so let's get straight...

### Multiply Rows of Matrix by Vector in R (Example)

Multiply Rows of Matrix by Vector in R (Example)   This article explains how to do a matrix multiplication with a vector in the R programming language . The tutorial will contain these content blocks: Here's the step-by-step process:   Creating...

### mutate & transmute R Functions of dplyr Package (2 Example Codes)

mutate & transmute R Functions of dplyr Package (2 Example Codes)   This article illustrates how to add new variables to data sets with the mutate & transmute functions of the dplyr package in the R programming language . The post is...

### NA Omit in R | 3 Example Codes for na.omit (Data Frame, Vector & by Column)

NA Omit in R | 3 Example Codes for na.omit (Data Frame, Vector & by Column)   Basic R Syntax: na.omit(data)   The na.omit R function removes all incomplete cases of a data object (typically of a data frame, matrix or vector)....

### na_if R Function of dplyr Package (2 Examples) | Convert Value to NA

na_if R Function of dplyr Package (2 Examples) | Convert Value to NA   In this article you'll learn how to replace NA values with the na_if function of the dplyr add-on package in the R programming language . The article will contain this: Example...

### Name Variables in for-Loop Dynamically in R (2 Examples)

Name Variables in for-Loop Dynamically in R (2 Examples)   In this tutorial, I'll illustrate how to name variables dynamically in a for-loop in R programming . Table of contents: Introduction of Exemplifying Data Example 1: Basic...

### names Function in R (2 Examples)

names Function in R (2 Examples)   This article illustrates how to get or set the names of a data object in the R programming language . The post consists of two examples for the application of the names function. To be more specific,...

### NaN in R Explained (Example Code) | is.nan Function, Count, Replace & Remove

NaN in R Explained (Example Code) | is.nan Function, Count, Replace & Remove   In the R programming language , NaN stands for Not a Number . This article explains how to deal with NaN values in R. This includes the application of the...

### near R Function of dplyr Package (2 Examples)

near R Function of dplyr Package (2 Examples)   In this article, I'll illustrate how to compare numeric vectors with the near function of the dplyr package in R programming . The post is structured as follows: Creating Exemplifying...

### Negative Binomial Distribution in R (4 Examples) | dnbinom, pnbinom, qnbinom & rnbinom Functions

Negative Binomial Distribution in R (4 Examples) | dnbinom, pnbinom, qnbinom & rnbinom Functions   This article illustrates how to use the negative binomial functions in the R programming language . The content of the article looks as...

### Nested ifelse Statement in R (2 Examples)

Nested ifelse Statement in R (2 Examples)   In this article you'll learn how to apply nested ifelse statements in the R programming language . Table of contents: Here's how to do it.   Example 1: Nested ifelse Statement...

### Nested Loop in R (2 Examples)

Nested Loop in R (2 Examples)   In this R tutorial you'll learn how to nest multiple loops . The article will consist of two examples for the nesting of while- and for-loops. To be more specific, the content is structured as follows: So...

### Normal Distribution in R (5 Examples) | dnorm, pnorm, qnorm & rnorm Functions

Normal Distribution in R (5 Examples) | dnorm, pnorm, qnorm & rnorm Functions   In this tutorial I'll introduce you to the normal distribution functions in the R programming language . Table of contents: Example 1: Normally Distributed...

### nth, first & last R Functions of dplyr Package (4 Examples)

nth, first & last R Functions of dplyr Package (4 Examples)   On this page, I'll explain how to extract certain values from a vector with the nth, first, and last functions of the dplyr package in the R programming language . The page...

### Number of Months Between Two Dates in R (Example)

Number of Months Between Two Dates in R (Example)   In this tutorial, I'll show how to compute the number of months between two different date objects in the R programming language . The article will consist of one example for the counting...

### Numbering Rows within Groups of Data Frame in R (2 Examples)

Numbering Rows within Groups of Data Frame in R (2 Examples)   This article illustrates how to add a counter to each group of a data frame in the R programming language . Table of contents: Constructing Example Data Example 1:...

### Obtain List of Directories in R (2 Examples) | list.dirs Function Explained

Obtain List of Directories in R (2 Examples) | list.dirs Function Explained   In this R tutorial you'll learn how to obtain a list of directories and folders contained at a specific path . Table of contents: You're here for the...

### Only Import Selected Columns of Data in R (2 Examples)

Only Import Selected Columns of Data in R (2 Examples)   In this tutorial you'll learn how to read only certain variables of a data frame in R . The content of the post is structured as follows: Let's do this.   Creation...

### openxlsx Package in R | Tutorial & Programming Examples

openxlsx Package in R | Tutorial & Programming Examples   The openxlsx R package simplifies the creation of excel files by providing an interface for the writing, styling, and editing of worksheets. Here you can find the documentation...

### optim Function in R (Example)

optim Function in R (Example)   On this page you'll learn how to apply a general-purpose optimization using the optim function in the R programming language . Table of contents: So without further ado, let's dive right in:   Creation...

### optimize Function in R (Example) | One Dimensional Optimization

optimize Function in R (Example) | One Dimensional Optimization   In this R tutorial you'll learn how to perform a one dimensional optimization using the optimize() function . The tutorial will contain these contents: Let's dig...

### Order Bars of ggplot2 Barchart in R (4 Examples)

Order Bars of ggplot2 Barchart in R (4 Examples)   In this R tutorial you'll learn how to order the bars of a ggplot2 barchart . The content is structured as follows: Creation of Example Data Example 1: Ordering Bars Manually ...

### Order Data Frame by Date in R (Example)

Order Data Frame by Date in R (Example)   In this tutorial, I'll explain how to sort a data frame based on a date column in the R programming language . The article will contain the following content: It's time to dive into the...

### Order Data Frame Rows According to Vector in R (2 Examples)

Order Data Frame Rows According to Vector in R (2 Examples)   In this R tutorial you'll learn how to sort data frame rows based on the values of a vector with a specific order . Table of contents: It's time to dive into the examples:   Creation...

### Overlay Density Plots in Base R (2 Examples)

Overlay Density Plots in Base R (2 Examples)   In this article, I'll show how to draw several Kernel densities in the same graphic in the R programming language . The table of content is structured as follows: So without further...

### Overlay ggplot2 Boxplot with Line in R (Example)

Overlay ggplot2 Boxplot with Line in R (Example)   In this post, I'll demonstrate how to add a line to a ggplot2 boxplot in the R programming language . The article will contain this: Let's start right away!   Example...

### Overlay ggplot2 Density Plots in R (2 Examples)

Overlay ggplot2 Density Plots in R (2 Examples)   In this tutorial, I'll explain how to plot several ggplot2 densities in the same graph in the R programming language . The page is structured as follows: Let's get started:   Example...

### Overlay Histogram with Fitted Density Curve in Base R & ggplot2 Package (2 Examples)

Overlay Histogram with Fitted Density Curve in Base R & ggplot2 Package (2 Examples)   In this tutorial you'll learn how to fit a density plot to a histogram in the R programming language . Table of contents: Introduction of Example...

### Overlay Normal Density Curve on Top of ggplot2 Histogram in R (Example)

Overlay Normal Density Curve on Top of ggplot2 Histogram in R (Example)   In this R tutorial you'll learn how to draw a ggplot2 histogram and a normal density line in the same graph . The tutorial will consist of one example for the plotting...

### par Function in R (3 Examples)

par Function in R (3 Examples)   In this R tutorial you'll learn how to set or query graphical parameters using the par function . Table of contents: Let's dig in.   Example 1: Create Graphic with Multiple Plots In...

### parse, deparse & expression Functions in R | Handle Character String & Expression

parse, deparse & expression Functions in R | Handle Character String & Expression   In this tutorial I will show you how to create expressions , how to convert characters to expressions , and how to convert expressions to characters . This...

### Pass Data Frame Column Name to Function in R (Example)

Pass Data Frame Column Name to Function in R (Example)   In this R tutorial you'll learn how to use variable names in manually created functions . Table of contents: Creating Example Data Example: Use Variable Names in User-Defined...

### paste & paste0 R Functions (4 Examples)

paste & paste0 R Functions (4 Examples)   This article explains how to use the paste and paste0 functions in R. First, let’s have a look at the basic R syntax and the definition of the two functions:   Basic R Syntax: paste("char1", "...

### Paste Multiple Columns Together in R (2 Examples)

Paste Multiple Columns Together in R (2 Examples)   In this tutorial, I'll explain how to merge multiple columns into one single variable in the R programming language . The article will consist of two examples for the combination of several...

### Pause R Script Until Key is Pressed in R (Example)

Pause R Script Until Key is Pressed in R (Example)   This article shows how to wait for a keypress in R programming . The post consists of these content blocks: Let's dive into it.   Example: Specify Keypress within User-Defined...

### pivot_longer & pivot_wider Functions of tidyr Package in R (2 Examples)

pivot_longer & pivot_wider Functions of tidyr Package in R (2 Examples)   In this R tutorial you'll learn how to apply the pivot_longer and pivot_wider functions of the tidyr add-on package . The content of the page looks like this: Let's...

### Play Sound at End of R Script (2 Examples) | beep Function

Play Sound at End of R Script (2 Examples) | beep Function   This tutorial illustrates how to make a sound at the end of a code in the R programming language . Table of contents: Example 1: Make Beep at End of Script Example 2:...

### Plot All Columns of Data Frame in R (3 Examples) | How to Draw Each Variable

Plot All Columns of Data Frame in R (3 Examples) | How to Draw Each Variable   In this tutorial, I'll explain how to draw all variables of a data set in a line plot in the R programming language . Table of contents: Let's dive right...

### Plot Data in R (8 Examples) | plot() Function

Plot Data in R (8 Examples) | plot() Function   This tutorial explains how to use the plot() function in the R programming language . The page consists of these topics: Creating Example Data Example 1: Basic Application of plot()...

### Plot Frequencies on Top of Stacked Bar Chart with ggplot2 in R (Example)

Plot Frequencies on Top of Stacked Bar Chart with ggplot2 in R (Example)   In this R programming tutorial you'll learn how to show data values on top of each bar of a stacked ggplot2 bar chart . The post contains one example for the plotting...

### Plot Line in R (8 Examples) | Create Line Graph & Chart in RStudio

Plot Line in R (8 Examples) | Create Line Graph & Chart in RStudio   In this R tutorial you'll learn how to draw line graphs . The article contains eight examples for the plotting of lines. To be more specific, the article looks as follows: Creating...

### Plot Mean in ggplot2 Barplot in R (Example)

Plot Mean in ggplot2 Barplot in R (Example)   This page explains how to create a ggplot2 barchart that shows the mean of each group in the R programming language . The page looks as follows: You're here for the answer, so let's...

### Plot Only One Variable in ggplot2 Plot in R (2 Examples)

Plot Only One Variable in ggplot2 Plot in R (2 Examples)   This tutorial explains how to draw a ggplot2 scatterplot with only one variable in the R programming language . Table of contents: If you want to know more about these topics,...

### Plot Only Text in R (2 Examples)

Plot Only Text in R (2 Examples)   In this tutorial, I'll show how to create a graphic that contains only text in the R programming language . The article contains the following information: Here's how to do it.   Example...

### plotrix Package in R | Tutorial & Programming Examples

plotrix Package in R | Tutorial & Programming Examples   The plotrix R package contains tools for the plotting of data in R. Here you can find the documentation of the plotrix package. Here you can find the CRAN page of the plotrix...

### Plotting Categorical Variable with Percentage Points Instead of Counts on Y-Axis in R (2 Examples)

Plotting Categorical Variable with Percentage Points Instead of Counts on Y-Axis in R (2 Examples)   In this R article you'll learn how to draw categories of a variable with percentage points on the y-axis . The post consists of two examples...

### plyr Package in R | Tutorial & Programming Examples

plyr Package in R | Tutorial & Programming Examples   The plyr R package contains tools for data manipulation in R. Here you can find the documentation of the plyr package. Here you can find the CRAN page of the plyr package. ...

### Poisson Distribution in R (4 Examples) | dpois, ppois, qpois & rpois Functions

Poisson Distribution in R (4 Examples) | dpois, ppois, qpois & rpois Functions   In this R tutorial you'll learn how to use the poisson functions . The content is structured as follows: Example 1: Poisson Density in R (dpois Function)...

### Position geom_text Labels in Grouped ggplot2 Barplot in R (Example)

Position geom_text Labels in Grouped ggplot2 Barplot in R (Example)   In this article, I'll demonstrate how to properly add text labels to a dodged ggplot2 barchart in R . The article consists of these contents: Let's take a look...

### print & cat Functions in R (3 Examples) | Return Data to RStudio Console

print & cat Functions in R (3 Examples) | Return Data to RStudio Console   In this article, I'll show how to use the print and cat functions in the R programming language . The article consists of three examples for the application of...

### Print Character String & Variable on Same Output Line in R (3 Examples)

Print Character String & Variable on Same Output Line in R (3 Examples)   In this tutorial, I'll show how to return character strings and data objects on the same line to the RStudio console in the R programming language . Table of contents: You're...

### Print Character String to Newline of RStudio Console in R (Example)

Print Character String to Newline of RStudio Console in R (Example)   In this tutorial, I'll illustrate how to show a character string with newlines in the RStudio console in the R programming language . Table of contents: Creation...

### Print Entire tibble to R Console (2 Examples)

Print Entire tibble to R Console (2 Examples)   In this tutorial you'll learn how to print a tibble to the console in the R programming language . The tutorial is structured as follows: Creation of Example Data Example 1: Display...

### Print First or Last Rows of Data Frame in R (4 Examples)

Print First or Last Rows of Data Frame in R (4 Examples)   In this R programming tutorial you'll learn how to return the first or last n rows of a data frame . The page is structured as follows: It's time to dive into the examples...   Constructing...

### Print ggplot2 Plot within for-Loop in R (Example)

Print ggplot2 Plot within for-Loop in R (Example)   In this article you'll learn how to draw ggplot2 plots within a for-loop in the R programming language . The post looks as follows: Introducing Example Data Example: Plotting...

### Print Output of Loop in R (Example) | Return Inside of while- & for-Loops

Print Output of Loop in R (Example) | Return Inside of while- & for-Loops   In this tutorial, I'll show how to return the output of a for-loop using the print function in the R programming language . The article contains these content...

### Print Time with Milliseconds in R (Example)

Print Time with Milliseconds in R (Example)   In this tutorial you'll learn how to return a time object with milliseconds in R . The tutorial consists of these topics: Let's dig in:   Creation of Example Data First,...

### Probability Distributions in R (Examples) | PDF, CDF & Quantile Function

Probability Distributions in R (Examples) | PDF, CDF & Quantile Function   This page explains the functions for different probability distributions provided by the R programming language . In general, R provides programming commands for...

### Proportions with dplyr Package in R (Example) | Create Relative Frequency Table

Proportions with dplyr Package in R (Example) | Create Relative Frequency Table   In this R tutorial you'll learn how to compute relative frequencies / proportions with the dplyr package . The article consists of the following contents: Creating...

### psych Package in R | Tutorial & Programming Examples

psych Package in R | Tutorial & Programming Examples   The psych R package provides tools for personality, psychometric theory and experimental psychology. Here you can find the documentation of the psych package. Here you can find...

### pull R Function of dplyr Package (2 Examples)

pull R Function of dplyr Package (2 Examples)   This article explains how to extract columns with the pull function of the dplyr add-on package in R programming . Table of contents: Creation of Example Data Example 1: Apply pull...

### quantile Function in R (6 Examples)

quantile Function in R (6 Examples)   This tutorial shows how to compute quantiles in the R programming language . The article is mainly based on the quantile() R function. So let's have a look at the basic R syntax and the definition...

### Quantile-Quantile Plot in R (4 Examples) | qqplot, qqnorm & qqline Functions | ggplot2 Package

Quantile-Quantile Plot in R (4 Examples) | qqplot, qqnorm & qqline Functions | ggplot2 Package   This tutorial explains how to draw QQplots in R programming . Table of contents: Example 1: Basic QQplot & Interpretation Example...

### Quit & Restart Clean R Session from within R (Example)

Quit & Restart Clean R Session from within R (Example)   In this tutorial, I'll illustrate how to close and restart a new R programming session from within RStudio in the R programming language . The article will contain these content...

### R abs Function (6 Example Codes) | How to Calculate an Absolute Value

R abs Function (6 Example Codes) | How to Calculate an Absolute Value   Basic R Syntax: abs(x)   The abs R function computes the absolute value of a numeric data object . The basic syntax for abs in R is illustrated above. In...

### R attach Warning: The following objects are masked

R attach Warning: The following objects are masked   In this R article you'll learn how to deal with the attach function warning "The following objects are masked" . The page is structured as follows: Let's start right away.   Constructing...

### R Capitalize First Letter of Each Word in Character String (3 Examples)

R Capitalize First Letter of Each Word in Character String (3 Examples)   In this post, I'll explain how to capitalize the first letter of each word of a character string in the R programming language . The tutorial consists of these contents: Creation...

### R cor Function Shows Only NA & 1 (2 Examples)

R cor Function Shows Only NA & 1 (2 Examples)   In this R programming tutorial you'll learn how to solve the problem that a correlation matrix shows only NA and 1 . The post will consist of these content blocks: Let's start right...

### R dplyr & plyr Error: Can't rename columns that don't exist. (2 Examples)

R dplyr & plyr Error: Can't rename columns that don't exist. (2 Examples)   On this page you'll learn how to reproduce and debug the "Error: Can't rename columns that don't exist." in the R programming language . The tutorial contains...

### R dplyr group_by & summarize Functions don't Work Properly (Example)

R dplyr group_by & summarize Functions don't Work Properly (Example)   In this R tutorial you'll learn how to make the group_by and summarize functions of the dplyr package work properly . Table of contents: Let's start right away!   Creation...

### R Equivalent to COUNTIF in Excel (Example)

R Equivalent to COUNTIF in Excel (Example)   This page shows how to realize Excel's COUNTIF function in the R programming language . The page will consist of the following: If you want to know more about these topics, keep reading.   Creation...

### R Error - Multiplication requires numeric/complex matrix/vector arguments

R Error - Multiplication requires numeric/complex matrix/vector arguments   In this R tutorial you'll learn how to handle the error message "requires numeric/complex matrix/vector arguments" . The post is structured as follows: Let's...

### R Error - Undefined Columns Selected when Subsetting Data Frame

R Error - Undefined Columns Selected when Subsetting Data Frame   In this article, I'll illustrate how to debug the error message - undefined columns selected in the R programming language . The content of the tutorial looks as follows: Let's...

### R Error : 'names' attribute must be the same length as the vector

R Error : 'names' attribute must be the same length as the vector   This article shows how to deal with the "Error in names() : 'names' attribute must be the same length as the vector" in the R programming language . The tutorial will...

### R Error in apply(data) : dim(X) must have a positive length

R Error in apply(data) : dim(X) must have a positive length   In this article you'll learn how to avoid the "Error in apply : dim(X) must have a positive length" in the R programming language . The post is structured as follows: Let's...

### R Error in as.Date.numeric(X) : 'origin' must be supplied (2 Examples)

R Error in as.Date.numeric(X) : 'origin' must be supplied (2 Examples)   This tutorial explains how to deal with the error message in as.Date.numeric(X) : 'origin' must be supplied in R . Table of contents: Here's how to do it.   Example...

### R Error in as.POSIXlt.character : string not standard unambiguous format

R Error in as.POSIXlt.character : string not standard unambiguous format   In this R tutorial you'll learn how to handle the "Error in as.POSIXlt.character : character string is not in a standard unambiguous format" . Table of contents: Let's...

### R Error in barplot.default() : 'height' must be a vector or a matrix (Example)

R Error in barplot.default() : 'height' must be a vector or a matrix (Example)   In this article you'll learn how to debug the "Error in barplot.default() : 'height' must be a vector or a matrix" in the R programming language . Table of...

### R Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)

R Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)   This article illustrates how to handle the "Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)" in the R programming language . Table of contents: Let's...

### R Error in file(file, "rt") : invalid 'description' argument (read.table & csv)

R Error in file(file, "rt") : invalid 'description' argument (read.table & csv)   This post illustrates how to deal with the "Error in file(file, "rt") : invalid 'description' argument" in R programming . The article contains this information: It's...

### R Error in Function: Unused Argument (2 Examples)

R Error in Function: Unused Argument (2 Examples)   This article explains how to deal with the error "unused argument" in the R programming language . Table of contents: Let's do this!   Example 1: Reproducing the Error...

### R Error in hist.default : 'x' must be numeric (2 Examples)

R Error in hist.default : 'x' must be numeric (2 Examples)   In this tutorial, I'll illustrate how to handle the error in hist.default(X) : 'x' must be numeric in R . The tutorial will contain two examples for the error message "x must...

### R Error in lm.fit(x, y, offset, singular.ok , ...) : 0 (non-NA) cases (2 Examples)

R Error in lm.fit(x, y, offset, singular.ok , ...) : 0 (non-NA) cases (2 Examples)   In this article, I'll illustrate how to debug the "Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases" in the R programming...

### R Error in lm.fit(x, y, offset, singular.ok, ...) : NA/NaN/Inf in 'x' (2 Examples)

R Error in lm.fit(x, y, offset, singular.ok, ...) : NA/NaN/Inf in 'x' (2 Examples)   In this R tutorial you'll learn how to deal with the "Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : NA/NaN/Inf in 'x'" . The...

### R Error in plot.window(...) : need finite 'xlim' values (2 Examples)

R Error in plot.window(...) : need finite 'xlim' values (2 Examples)   This article illustrates how to handle the plot error "need finite 'xlim' values" in R . Table of contents: Let's dive into it...   Creation of Example...

### R Error in read.table : more columns than column names (3 Examples)

R Error in read.table : more columns than column names (3 Examples)   In this R tutorial you'll learn how to handle the error message "more columns than column names" . The content of the page is structured as follows: You're here...

### R Error in read.table: duplicate 'row.names' are not allowed (3 Examples)

R Error in read.table: duplicate 'row.names' are not allowed (3 Examples)   This article explains how to deal with the error message "duplicate 'row.names' are not allowed" in R programming . The article is structured as follows: Let's...

### R Error in scan: Line 1 did not have X Elements (3 Examples)

R Error in scan: Line 1 did not have X Elements (3 Examples)   In this R tutorial you'll learn how to handle the error in scan : line 1 did not have X elements . Table of contents: Let's dig in:   Example 1: Reproduce...

### R Error in setwd() : cannot change working directory (2 Examples)

R Error in setwd() : cannot change working directory (2 Examples)   In this article you'll learn how to deal with the "Error in setwd() : cannot change working directory" in the R programming language . Table of contents: Let's...

### R Error in solve.default() : Lapack routine dgesv: system is exactly singular

R Error in solve.default() : Lapack routine dgesv: system is exactly singular   In this post you'll learn how to handle the "Error in solve.default() : Lapack routine dgesv: system is exactly singular" in the R programming language . The...

### R Error in strsplit : non-character argument (Example)

R Error in strsplit : non-character argument (Example)   In this tutorial, I'll show how to handle the "Error in strsplit : non-character argument" in the R programming language . Table of contents: It's time to dive into the examples...   Creating...

### R Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' length differ

R Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' length differ   In this R tutorial you'll learn how to handle the error in xy.coords that 'x' and 'y' lengths differ . The content of the post is structured like this: So...

### R Error: `n()` must only be used inside dplyr verbs. (2 Examples)

R Error: `n()` must only be used inside dplyr verbs. (2 Examples)   In this article, I'll illustrate how to reproduce and fix the error message "must only be used inside dplyr verbs" in the R programming language . The post is structured...

### R Error: 'R' is an unrecognized escape in character string starting ""C:R"

R Error: 'R' is an unrecognized escape in character string starting ""C:R"   In this R tutorial you'll learn how to deal with the Error: 'R' is an unrecognized escape in character string starting ""C:R" . The content of the post looks...

### R Error: \$-Operator is Invalid for Atomic Vectors (Examples)

R Error: \$-Operator is Invalid for Atomic Vectors (Examples)   In this tutorial you'll learn how to fix the error message "\$ operator is invalid for atomic vectors" in R . The content of the post looks as follows: Let's get started:   Example...

### R Error: Argument is of Length Zero (Example)

R Error: Argument is of Length Zero (Example)   In this article, I'll illustrate how to fix the error message "argument is of length zero" in the R programming language . Table of contents: So now the part you have been waiting...

### R Error: Arguments Imply Differing Number of Rows (2 Examples)

R Error: Arguments Imply Differing Number of Rows (2 Examples)   This article illustrates how to handle the error message "arguments imply differing number of rows" in the R programming language . The content of the post is structured...

### R Error: Cannot Allocate Vector of Size N GB (2 Examples) | How to Increase the Memory Limit

R Error: Cannot Allocate Vector of Size N GB (2 Examples) | How to Increase the Memory Limit   This tutorial shows how to increase or decrease the memory limit in R . The tutorial contains two examples for the modification of memory limits...

### R Error: contrasts can be applied only to factors with 2 or more levels

R Error: contrasts can be applied only to factors with 2 or more levels   This tutorial illustrates how to handle the error message "contrasts can be applied only to factors with 2 or more levels" in the R programming language . The article...

### R Error: Could not Find Function X (2 Examples)

R Error: Could not Find Function X (2 Examples)   In this article you'll learn how to solve the R programming error "could not find function X" in R . The tutorial consists of two examples for the error message "could not find function...

### R Error: incorrect number of dimensions (2 Examples)

R Error: incorrect number of dimensions (2 Examples)   This tutorial explains how to avoid the error "incorrect number of dimensions" in the R programming language . The table of content is structured as follows: You're here for...

### R Error: incorrect number of subscripts on matrix (2 Examples)

R Error: incorrect number of subscripts on matrix (2 Examples)   This article illustrates how to handle the error message "incorrect number of subscripts on matrix" in the R programming language . The content of the tutorial looks as follows: If...

### R Error: Invalid Graphics State (2 Examples)

R Error: Invalid Graphics State (2 Examples)   This page illustrates how to handle the "invalid graphics state" error message in the R programming language . The article contains the following content: Let's dive right into the...

### R Error: JAVA_HOME cannot be determined from the Registry (Example)

R Error: JAVA_HOME cannot be determined from the Registry (Example)   This article shows how to handle the error message "JAVA_HOME cannot be determined from the Registry" in the R programming language . The tutorial will contain these...

### R Error: Non-numeric Argument to Binary Operator | How to Fix (Example)

R Error: Non-numeric Argument to Binary Operator | How to Fix (Example)   This tutorial illustrates how to deal with the error message "non-numeric argument to binary operator" in the R programming language . Table of contents: Let's...

### R Error: Object of Type Closure is not Subsettable in R (2 Examples)

R Error: Object of Type Closure is not Subsettable in R (2 Examples)   In this tutorial, I'll show how to fix the error object of type 'closure' is not subsettable in the R programming language . The content of the post looks as follows: Here's...

### R Error: Object X not Found (2 Examples)

R Error: Object X not Found (2 Examples)   This tutorial explains how to reproduce and fix the error message "object X not found" in R . The article contains the following topics: Let's start right away...   Example 1:...

### R Error: Package or Namespace Load Failed for ggplot2 & data.table

R Error: Package or Namespace Load Failed for ggplot2 & data.table   This page explains how to handle the error message package or namespace load failed for ggplot2 and for data.table in R . The article contains the following topics:   Fixing...

### R Error: plot.new has not been called yet (2 Examples)

R Error: plot.new has not been called yet (2 Examples)   In this R programming article you'll learn how to solve the error "plot.new has not been called yet" . The page looks as follows: It's time to dive into the exemplifying R...

### R Error: Replacement has X Rows, Data has Y (2 Examples)

R Error: Replacement has X Rows, Data has Y (2 Examples)   This tutorial explains how to handle the error message "replacement has X rows, data has Y" in the R programming language . The tutorial consists of this information: Let's...

### R Error: Subscript Out of Bounds (Example)

R Error: Subscript Out of Bounds (Example)   In this R tutorial you'll learn how to fix the error message subscript out of bounds . The article is structured as follows: Let's start right away.   Creating Example Data...

### R Error: unexpected '}' in Code (2 Examples)

R Error: unexpected '}' in Code (2 Examples)   In this R article you'll learn how to fix the error message "unexpected '}' in X" . Table of contents: Let's jump right to the examples...   Example 1: Reproduce the Error...

### R Error: Unexpected else in "else" (2 Examples)

R Error: Unexpected else in "else" (2 Examples)   In this R tutorial you'll learn how to solve the error unexpected else in "else" . The table of content looks as follows: Let's just jump right in.   Example 1: Reproduce...

### R Error: Unexpected Input in X (2 Examples)

R Error: Unexpected Input in X (2 Examples)   This article illustrates how to deal with the error message "unexpected input in X" in the R programming language . The page contains these contents: Let's take a look at some R codes...

### R Error: Unexpected Numeric Constant in X (2 Examples)

R Error: Unexpected Numeric Constant in X (2 Examples)   In this R tutorial you'll learn how to handle the error message "unexpected numeric constant in X" . The tutorial consists of the following content: Here's how to do it!   Example...

### R Error: Unexpected SPECIAL in X (2 Examples)

R Error: Unexpected SPECIAL in X (2 Examples)   In this R tutorial you'll learn how to deal with the error message "unexpected SPECIAL in X" . The post is structured as follows: If you want to know more about these content blocks,...

### R Error: Unexpected String Constant in X (2 Examples)

R Error: Unexpected String Constant in X (2 Examples)   In this article you'll learn how to fix the error "unexpected string constant in X" in R . The article will consist of this content: Let's dive right in.   Example...

### R Error: Unexpected Symbol in X (2 Examples)

R Error: Unexpected Symbol in X (2 Examples)   In this tutorial, I'll show how to fix the error message "unexpected symbol in X" in the R programming language . The post will contain the following topics: If you want to learn more...

### R eval Function (3 Examples) | Evaluate Expressions & Character Strings

R eval Function (3 Examples) | Evaluate Expressions & Character Strings   In this R tutorial, I'll explain how to evaluate an expression with the eval function. Let's first have a look at the basic R syntax and the definition of eval:   Basic...

### R File Extension (Explained) | How to Open an .r File in RStudio?

R File Extension (Explained) | How to Open an .r File in RStudio?   R files are programming scripts written by the R programming language . The R programming language is a powerful software tool that provides functions for statistical data...

### R Find Missing Values (6 Examples for Data Frame, Column & Vector)

R Find Missing Values (6 Examples for Data Frame, Column & Vector) Let's face it: Missing values are an issue of almost every raw data set! If we don't handle our missing data in an appropriate way, our estimates are likely to be biased. However,...

### R Functions List (+ Examples) | All Basic Commands of the R Programming Language

R Functions List (+ Examples) | All Basic Commands of the R Programming Language   List of R Commands & Functions abline - Add straight lines to plot. abs - Compute the absolute value of a numeric data object....

### R ggplot2 Error: Aesthetics must be either length 1 or the same as the data

R ggplot2 Error: Aesthetics must be either length 1 or the same as the data   In this tutorial you'll learn how to fix the error message "Aesthetics must be either length 1 or the same as the data" in the R programming language . Table...

### R ggplot2 Error: Continuous value supplied to discrete scale (2 Examples)

R ggplot2 Error: Continuous value supplied to discrete scale (2 Examples)   In this article, I'll show how to handle the "Error: Continuous value supplied to discrete scale" in the R programming language . The tutorial will consist of...

### R ggplot2 Error: Discrete Value Supplied to Continuous Scale (2 Examples)

R ggplot2 Error: Discrete Value Supplied to Continuous Scale (2 Examples)   This article explains how to handle the ggplot2 error "Discrete value supplied to continuous scale" in the R programming language . Table of contents: Let's...

### R ggplot2 Error: Don't know how to automatically pick scale for object type

R ggplot2 Error: Don't know how to automatically pick scale for object type   This article illustrates how to deal with the ggplot2 error "Don't know how to automatically pick scale for object type" in R . The tutorial contains this information: Let's...

### R ggplot2 Error: geom_point requires the following missing aesthetics: x, y

R ggplot2 Error: geom_point requires the following missing aesthetics: x, y   In this article, I'll explain how to debug the ggplot2 "Error: geom_point requires the following missing aesthetics: y" in R programming . The tutorial will...

### R ggplot2 Error: Mapping should be created with `aes()` or `aes_()`.

R ggplot2 Error: Mapping should be created with `aes()` or `aes_()`.   In this R tutorial you'll learn how to debug the ggplot2 error message "Error: Mapping should be created with `aes()` or `aes_()`." . The content of the article is...

### R ggplot2 Error: stat_count() must not be used with a y aesthetic (Example)

R ggplot2 Error: stat_count() must not be used with a y aesthetic (Example)   In this article you'll learn how to handle the error message "stat_count() must not be used with a y aesthetic." in the R programming language . Table of contents: If...

### R ggplot2 Warning Message - Use of data\$X is discouraged. Use X instead

R ggplot2 Warning Message - Use of data\$X is discouraged. Use X instead   This tutorial explains how to avoid the ggplot2 warning message "Use of data\$column is discouraged. Use column instead" in R . The page contains two examples for...

### R ggplot2 Warning Message: Removed rows containing missing values

R ggplot2 Warning Message: Removed rows containing missing values   In this R article you'll learn how to replicate and fix the ggplot2 warning message "Removed X rows containing missing values" . The table of content looks as follows: Let's...

### R ggplot2 Warning: Scale for 'fill' is already present - Replace existing

R ggplot2 Warning: Scale for 'fill' is already present - Replace existing   In this tutorial you'll learn how to handle the ggplot2 warning message "Scale for 'fill' is already present. Adding another scale for 'fill', which will replace the...

### R Help - Error in if (NA) { : missing value where TRUE/FALSE needed

R Help - Error in if (NA) { : missing value where TRUE/FALSE needed   In this R tutorial you'll learn how to deal with the error message Error in if (NA) { : missing value where TRUE/FALSE needed . Table of contents: Basic Explanation:...

### R Help (2 Examples) - Warning: invalid factor level, NA generated

R Help (2 Examples) - Warning: invalid factor level, NA generated   In this tutorial, I'll illustrate how to handle the warning message invalid factor level, NA generated in R . The tutorial contains the following: Example 1: Invalid...

### R How to Fix: Error in plot.new() : figure margins too large (3 Examples)

R How to Fix: Error in plot.new() : figure margins too large (3 Examples)   In this tutorial, I'll explain how to handle the error message "Error in plot.new() : figure margins too large" in the R programming language . The tutorial will...

### R is.na Function Example (remove, replace, count, if else, is not NA)

R is.na Function Example (remove, replace, count, if else, is not NA) Well, I guess it goes without saying that NA values decrease the quality of our data. Fortunately, the R programming language provides us with a function that helps us to deal...

### R Loop Through Data Frame Columns & Rows (4 Examples) | for-, while- & repeat-Loops

R Loop Through Data Frame Columns & Rows (4 Examples) | for-, while- & repeat-Loops   In this article you'll learn how to loop over the variables and rows of a data matrix in the R programming language . The article will consist of the...

### R max and min Functions | 8 Examples: Remove NA Value, Two Vectors, Column & Row

R max and min Functions | 8 Examples: Remove NA Value, Two Vectors, Column & Row   In this article, you will learn how to use min and max in R. I'm going to explain both functions in the same tutorial, since the R syntax of the two functions...

### R merge Error in fix.by(by.y, y) : 'by' must specify a uniquely valid column

R merge Error in fix.by(by.y, y) : 'by' must specify a uniquely valid column   In this tutorial you'll learn how to handle the "Error in fix.by(by.y, y) : 'by' must specify a uniquely valid column" in the R programming language . The tutorial...

### R Merge Multiple Data Frames in List (2 Examples) | Base R vs. tidyverse

R Merge Multiple Data Frames in List (2 Examples) | Base R vs. tidyverse   On this page you'll learn how to simultaneously merge multiple data frames in a list in the R programming language . The tutorial will contain two examples or more...

### R NA – What are <Not Available> Values?

R NA – What are <Not Available> Values? Your data contains NA, <NA>, or NaN values? That's not the end of the world -- but your alarm bells should start ringing! In R (or R Studio) , NA stands for Not Available . Each cell of your d...

### R outer Function | 4 Example Codes (Basic Application & User Defined)

R outer Function | 4 Example Codes (Basic Application & User Defined)   Basic R Syntax: outer(x, y, "*")   The R outer function applies a function to two arrays . The basic R code for the outer command is shown above. In...

### R pairs & ggpairs Plot Functions | 5 Example Codes (Color, Labels, Panels & by Group)

R pairs & ggpairs Plot Functions | 5 Example Codes (Color, Labels, Panels & by Group)   Basic R Syntax: pairs(data)   The pairs R function returns a plot matrix, consisting of scatterplots for each variable-combination of...

### R polygon Function | 6 Example Codes (Frequency & Density Plot)

R polygon Function | 6 Example Codes (Frequency & Density Plot)   Basic R Syntax: polygon(x_coordinates, y_coordinates)   The R polygon function draws a polygon to a plot . The basic R syntax for the polygon command is illustrated...

### R predict Error in eval(predvars, data, env) : numeric 'envir' arg not of length one

R predict Error in eval(predvars, data, env) : numeric 'envir' arg not of length one   This tutorial illustrates how to deal with the "Error in eval(predvars, data, env) : numeric 'envir' arg not of length one" in R . Table of contents: Let's...

### R predict() Warning message: 'newdata' had X rows but variables found have Y rows

R predict() Warning message: 'newdata' had X rows but variables found have Y rows   In this article, I'll show how to handle the predict function "Warning message: 'newdata' had X rows but variables found have Y rows" in R programming . The...

### R pretty Function | 3 Example Codes (Interval Sequence & Set Axis Labels of Plot)

R pretty Function | 3 Example Codes (Interval Sequence & Set Axis Labels of Plot)   Basic R Syntax: pretty(x)   The pretty R function computes a sequence of equally spaced round values . The basic R syntax for the pretty command...

### R rbind Function Error: Names don't Match Previous Names (3 Examples)

R rbind Function Error: Names don't Match Previous Names (3 Examples)   In this tutorial, I'll explain how to deal with the error message "names do not match previous names" in the R programming language . Table of contents: If...

### R Replace Last Comma of Character with &-Sign (5 Examples)

R Replace Last Comma in Character with &-Sign (5 Examples) If you are working with text data, you will often have a list or enumeration of words that is separated by commas, e.g.: "Ball, Animal, Beer, Pig, Wagon, Balloon, Hero" The last comma...

### R Replace NA with 0 (10 Examples for Data Frame, Vector & Column)

R Replace NA with 0 (10 Examples for Data Frame, Vector & Column) A common way to treat missing values in R is to replace NA with 0. You will find a summary of the most popular approaches in the following. Choose one of these approaches according...

### R scan Function (5 Example Codes) | Read Text or CSV File Line by Line

R scan Function (5 Example Codes) | Read Text or CSV File Line by Line   In this article, I'll explain how to use the scan function to read data into R . Let's first have a look at the basic R syntax and the definition of scan():   Basic...

### R Set Row & Column Names of Data with Unknown Dimension (Example)

R Set Row & Column Names of Data with Unknown Dimension (Example)   In this article you'll learn how to change row and column names of a data frame or matrix without knowing the dimensions in the R programming language . The post consists...

### R sink Function (3 Examples) | Export R output as txt & csv File

R sink Function (3 Examples) | Export R output as txt & csv File   In this article, I'll explain how to use the sink function in R. I'll show you in three examples how to: print text to a txt file (Example 1) export data as txt...

### R substr & substring Functions | Examples: Remove, Replace, Match in String

R substr & substring Functions | Examples: Remove, Replace, Match in String   In this R tutorial, I'll show you how to apply the substr and substring functions . I'll explain both functions in the same article, since the R syntax and the output...

### R sweep Function | 3 Example Codes (Matrix Operation with MARGIN & STATS)

R sweep Function | 3 Example Codes (Matrix Operation with MARGIN & STATS)   Basic R Syntax: sweep(x = data, MARGIN = 1, STATS = 1, FUN = "+")   The sweep R function applies an operation (e.g. + or -) to a data matrix by row...

### R transform Function (2 Example Codes) | Transformation of Data Frames

R transform Function (2 Example Codes) | Transformation of Data Frames   In this tutorial, I'll explain you how to modify data with the transform function. Let's first have a look at the basic R syntax and the definition of the function:   Basic...

### R union Function | 3 Example Codes (Two Vectors, Data Frames & Lists)

R union Function | 3 Example Codes (Two Vectors, Data Frames & Lists)   Basic R Syntax: union(x1, x2)   In R , the union function returns all values that appear in at least one of two data objects (usually vectors). Each value...

### R unlist Function | 3 Example Codes (List of Vectors, Data Frame & String)

R unlist Function | 3 Example Codes (List of Vectors, Data Frame & String)   Basic R Syntax: unlist(my_list)   The unlist R function converts a list to a single vector. The basic code for unlist in R is illustrated above. In...

### R Warning Message - In Ops.factor : not meaningful for factors (Example)

R Warning Message - In Ops.factor : not meaningful for factors (Example)   This article shows how to deal with the warning message "In Ops.factor : not meaningful for factors" in the R programming language . The article will contain these...

### R Warning message in min & max: no non-missing arguments; returning Inf

R Warning message in min & max: no non-missing arguments; returning Inf   This article explains how to debug the warning message in min and max - "no non-missing arguments; returning Inf" in the R programming language . The tutorial is...

### R Warning Message in read.table: Incomplete Final Line Found by readTableHeader

R Warning Message in read.table: Incomplete Final Line Found by readTableHeader   In this article, I'll show how to deal with the read.table warning message "incomplete final line found by readTableHeader" in the R programming language . The...

### R Warning Message: Condition Length > 1 Only First Element Will Be Used

R Warning Message: Condition Length > 1 Only First Element Will Be Used   This post shows how to handle the warning message "the condition has length > 1 and only the first element will be used" in the R programming language . The content...

### R Warning message: In scan(file... : embedded nul(s) found in input

R Warning message: In scan(file... : embedded nul(s) found in input   In this R tutorial you'll learn how to deal with the "Warning message: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : embedded nul(s) found in...

### R Warning Message: NAs Introduced by Coercion (Example)

R Warning Message: NAs Introduced by Coercion (Example)   This article explains how to debug the warning message "NAs introduced by coercion" in the R programming language . The content of the post is structured as follows: Let's...

### R Warning Message: Number of items to Replace is not Multiple of Length

R Warning Message: Number of items to Replace is not Multiple of Length   This tutorial shows how to avoid the warning message "number of items to replace is not a multiple of replacement length" in R . Table of contents: Here's...

### R Warning: cannot remove prior installation of Package 'X'

R Warning: cannot remove prior installation of Package 'X'   In this R post you'll learn how to deal with the warning: cannot remove prior installation of package . The page looks as follows: Let's dive right in...   Fixing...

### R.Version Function in R (Examples) | Which Version is Currently Running?

R.Version Function in R (Examples) | Which Version is Currently Running?   In this tutorial you'll learn how to extract the current version in the R programming language . Table of contents: Let's get started!   Example...

### Random Numbers in R (2 Examples) | Draw Randomly from Probability Distribution & Given Data

Random Numbers in R (2 Examples) | Draw Randomly from Probability Distribution & Given Data   In this article, I'll explain how to draw random numbers in R programming . Table of contents: Example 1: Draw Random Numbers from Probability...

### Randomize Vector in R (Example) | Shuffle & Mix Elements Randomly

Randomize Vector in R (Example) | Shuffle & Mix Elements Randomly   In this R programming tutorial you'll learn how to shuffle a vector or array randomly . The content is structured as follows: Let's dive right into the R code.   Creation...

### Randomly Reorder Data Frame by Row and Column in R (2 Examples)

Randomly Reorder Data Frame by Row and Column in R (2 Examples)   In this R tutorial you'll learn how to shuffle the rows and columns of a data frame randomly . The article contains two examples for the random reordering. More precisely,...

### Rank Functions of dplyr Package in R (row_number, ntile, min_rank, dense_rank, percent_rank & cume_dist)

Rank Functions of dplyr Package in R (row_number, ntile, min_rank, dense_rank, percent_rank & cume_dist)   In this tutorial, I'll illustrate how to apply the rank functions of the dplyr package in the R programming language . The rank functions...

### rbind Data Frames by Column Index in R (Example)

rbind Data Frames by Column Index in R (Example)   In this tutorial you'll learn how to ignore variable names when applying the rbind() function in R programming . Table of contents: Sound good? Great, let's just jump right in...   Example...

### rbind in R | 3 Examples (Vector, Data Frame & rbind.fill for Missing Columns)

rbind in R | 3 Examples (Vector, Data Frame & rbind.fill for Missing Columns)   Basic R Syntax: rbind(my_data, new_row)   The name of the rbind R function stands for row-bind . The rbind function can be used to combine several...

### Read All Files in Directory & Apply Function to Each Data Frame in R (Example)

Read All Files in Directory & Apply Function to Each Data Frame in R (Example)   In this tutorial you'll learn how to import all data frames from a folder and apply a function to each of them in R programming . Table of contents: With...

### Read All Worksheets of Excel File into List in R (Example)

Read All Worksheets of Excel File into List in R (Example)   In this tutorial, I'll illustrate how to import all sheets of an Excel file to a list in R . The tutorial will consist of this: Here's how to do it...   Example...

### Read Fixed Width Text File in R (Example)

Read Fixed Width Text File in R (Example)   In this article, I'll explain how to import a fixed width text file in the R programming language . Table of contents: Example: Reading Fixed Width Text File from Website Video, Further...

### Read Only Header of File in R (2 Examples)

Read Only Header of File in R (2 Examples)   In this article, I'll illustrate how to import only the header of an external file in the R programming language . Table of contents: Let's dive right in!   Creation of Exemplifying...

### Read SPSS sav File into R (2 Examples)

Read SPSS sav File into R (2 Examples)   In this post you'll learn how to import an SPSS .sav file in R . The page consists of two examples for the importing of .sav files. To be more specific, the article will contain this: Let's...

### Read TXT File with Spaces as Delimiter in R (Example)

Read TXT File with Spaces as Delimiter in R (Example)   In this tutorial you'll learn how to import a text file with spaces as separator in the R programming language . The article will consist of this information: Let's get started...   Creating...

### Read xlsx & xls Excel File in R (6 Examples)

Read xlsx & xls Excel File in R (6 Examples)   This tutorial explains how to read Excel files in R . More precisely, I will show you how to: Read an xlsx File with the read.xlsx Function of the xlsx Package (Example 1 ) Read an...

### reader Package in R | Tutorial & Programming Examples

reader Package in R | Tutorial & Programming Examples   The reader R package provides simplified tools for the reading of data from files. Here you can find the CRAN page of the reader package.   Tutorials on the reader...

### readLines, n.readLines & readline in R (6 Example Codes)

readLines, n.readLines & readline in R (6 Example Codes)   In this tutorial, I’m going to show you how to read text by line with three different R functions : readLines (Examples 1-4) n.readLines (Example 5) readline (Example 6) ...

### readxl Package in R | Tutorial & Programming Examples

readxl Package in R | Tutorial & Programming Examples   The readxl R package provides tools for the import of excel files into R. The readxl package is part of the tidyverse environment . Here you can find the documentation of the readxl...

### recode & recode_factor R Functions of dplyr Package (2 Examples)

recode & recode_factor R Functions of dplyr Package (2 Examples)   In this article you'll learn how to replace certain values with the recode and recode_factor functions of the dplyr package in R . The article looks as follows: Example...

### Reduce Space Around Plot in R (Examples)

Reduce Space Around Plot in R (Examples)   This article shows how to set the area margins of graphics in the basic installation of R . The page contains two examples for the reduction of space around plots. More precisely, the content...

### Remove All Objects But One from Workspace in R (Example)

Remove All Objects But One from Workspace in R (Example)   In this tutorial you'll learn how to clear all data objects from the workspace except one in the R programming language . The tutorial will consist of the following contents: Let's...

### Remove All Special Characters from String in R (2 Examples)

Remove All Special Characters from String in R (2 Examples)   In this R programming tutorial you'll learn how to delete punctuation and non-alphanumeric characters from a character string . The article will consist of two examples for...

### Remove All White Space from Character String in R (2 Examples)

Remove All White Space from Character String in R (2 Examples)   In this R post you'll learn how to delete white space from a character string . Table of contents: Let's take a look at some R codes in action...   Creation...

### Remove All Whitespace in Each Data Frame Column in R (2 Examples)

Remove All Whitespace in Each Data Frame Column in R (2 Examples)   In this tutorial, I'll show how to delete all blanks in data frame variables in the R programming language . The content of the article looks like this: Let's dive...

### Remove All-NA Columns from Data Frame in R (Example)

Remove All-NA Columns from Data Frame in R (Example)   In this article you'll learn how to drop columns where all values are NA in the R programming language . The content of the tutorial is structured like this: Example Data Example:...

### Remove Axis Labels & Ticks of ggplot2 Plot (R Programming Example)

Remove Axis Labels & Ticks of ggplot2 Plot (R Programming Example)   This tutorial illustrates how to delete axis labels and ticks of a ggplot2 plot in R . The article will consist of one examples for the removal of axis information. To...

### Remove Axis Values of Plot in Base R (3 Examples)

Remove Axis Values of Plot in Base R (3 Examples)   In this tutorial, I'll show how to remove axis values of a plot in Base R . The article contains three examples for the removal of axis values. To be more precise, the tutorial contains...

### Remove Border of ggplot2 geom_label Text Annotation in R (Example)

Remove Border of ggplot2 geom_label Text Annotation in R (Example)   In this R tutorial you'll learn how to get rid of ggplot2 text annotation borders . The article contains the following contents: Here's how to do it.   Example...

### Remove Bottom N Rows from Data Frame in R (2 Examples)

Remove Bottom N Rows from Data Frame in R (2 Examples)   In this tutorial, I'll explain how to drop the last N rows of a data frame in the R programming language . Table of contents: Let's dig in.   Creation of Exemplifying...

### Remove Characters Before or After Point in String in R (Example)

Remove Characters Before or After Point in String in R (Example)   This article shows how to delete characters in a character string before or after a point in the R programming language . The page is structured as follows: Let's...

### Remove Data Frame Columns by Name in R (6 Examples)

Remove Data Frame Columns by Name in R (6 Examples)   In this article, I'll explain how to delete data frame variables by their name in R programming . The article will contain this content: Here's how to do it!   Example...

### Remove Duplicated Rows from Data Frame in R (Example)

Remove Duplicated Rows from Data Frame in R (Example)   This tutorial illustrates how to eliminate duplicated rows from a data frame in R programming . Table of contents: Creation of Example Data Example: Delete Duplicated Rows...

### Remove Element from List in R (7 Example Codes) | How to Delete a List Component

Remove Element from List in R (7 Example Codes) | How to Delete a List Component   In this tutorial, I will show you how to remove one or multiple elements from a list in R . The article is structured as follows: Creating an Example...

### Remove Empty Rows of Data Frame in R (2 Examples)

Remove Empty Rows of Data Frame in R (2 Examples)   In this R programming tutorial you'll learn how to delete rows where all data cells are empty . The tutorial distinguishes between empty in a sense of an empty character string (i.e....

### Remove First Row of Data Frame in R (Example)

Remove First Row of Data Frame in R (Example)   In this article you'll learn how to delete the first row of a data set in the R programming language . The tutorial will contain the following content: It's time to dive into the example.   Introducing...

### Remove Grid, Background Color, Top & Right Borders from ggplot2 Plot in R (Example)

Remove Grid, Background Color, Top & Right Borders from ggplot2 Plot in R (Example)   In this tutorial you'll learn how to delete background grids, colors, and top/right borders of ggplot2 plots in the R programming language . The table...

### Remove Header from Data in R (Example)

Remove Header from Data in R (Example)   In this article you'll learn how to delete the column names from a data frame or matrix in the R programming language . Table of contents: Let's just jump right in...   Creation...

### Remove Intercept from Regression Model in R (2 Examples)

Remove Intercept from Regression Model in R (2 Examples)   In this tutorial you'll learn how to estimate a linear regression model without intercept in the R programming language . Table of contents: Let's get started!   Example...

### Remove Labels from ggplot2 Facet Plot in R (Example)

Remove Labels from ggplot2 Facet Plot in R (Example)   This tutorial explains how to delete all labels and boxes from a ggplot2 facet plot in R programming . The article will contain one example for the creation of facet plots without...

### Remove Last N Elements of Vector in R (2 Examples)

Remove Last N Elements of Vector in R (2 Examples)   In this tutorial, I'll illustrate how to delete the last N elements of a vector object in the R programming language . Table of contents: It's time to dive into the examples...   Construction...

### Remove Leading and Trailing Zeros in R (5 Examples)

Remove Leading and Trailing Zeros in R (5 Examples)   In this R tutorial you'll learn how to delete zeros at the beginning and at the end of a value . The tutorial consists of the following content: Let's dive into it...   Creation...

### Remove Legend in ggplot2 (3 Example Codes) | Delete One or All Legends

Remove Legend in ggplot2 (3 Example Codes) | Delete One or All Legends   This tutorial shows how to remove legends in plots of the R ggplot2 package . The article is structured as follows: Creating Example Data Hide All Legends...

### Remove Legend Title from ggplot2 Plot in R (Example)

Remove Legend Title from ggplot2 Plot in R (Example)   In this R post you'll learn how to delete a legend title in a ggplot2 plot . The content looks as follows: Example Data Example: Create ggplot2 Scatterplot without Legend Title...

### Remove Multiple Columns from data.table in R (Example)

Remove Multiple Columns from data.table in R (Example)   In this tutorial, I'll illustrate how to delete several data.table variables in R . The content of the tutorial is structured like this: Let's dive right into the example...   Example...

### Remove Multiple Data Objects Using rm Function in R (Example)

Remove Multiple Data Objects Using rm Function in R (Example)   In this tutorial, I'll illustrate how to delete several data objects from the R environment running the rm function only once in the R programming language . The content of...

### Remove Multiple Values from Vector in R (Example)

Remove Multiple Values from Vector in R (Example)   On this page, I'll show how to delete certain values from a vector in the R programming language . The content of the page looks as follows: Creating Example Data Example: Delete...

### Remove NA Values from ggplot2 Plot in R (Example)

Remove NA Values from ggplot2 Plot in R (Example)   In this article, I'll explain how to eliminate NA values from a ggplot2 graphic in R . Table of contents: Let's start right away...   Example Data, Add-On Packages &...

### Remove NA Values from Vector in R (2 Examples)

Remove NA Values from Vector in R (2 Examples)   In this article you'll learn how to remove NA values from a vector in the R programming language . Table of contents: Creation of Example Data Example 1: Create New Vector without...

### Remove Newline from Character String in R (2 Examples)

Remove Newline from Character String in R (2 Examples)   On this page you'll learn how to delete all line breaks (i.e. enter symbols) from character strings in the R programming language . Table of contents: Let's get started!   Creation...

### Remove Outliers from Data Set in R (Example)

Remove Outliers from Data Set in R (Example)   In this article you'll learn how to delete outlier values from a data vector in the R programming language . Table of contents: Let's dive into it.   Creation of Example...

### Remove Row & Column Names from Matrix in R (2 Examples)

Remove Row & Column Names from Matrix in R (2 Examples)   In this article you'll learn how to drop all row and column names of a matrix object in R . Table of contents: Let's start right away!   Example Data We use...

### Remove Rows with Any Zero Value in R (Example)

Remove Rows with Any Zero Value in R (Example)   In this tutorial, I'll illustrate how to delete data frame rows where at least one value is equal to zero in the R programming language . Table of contents: Let's dig in...   Creation...

### Remove Rows with NA in R Data Frame (6 Examples) | Some or All Missing

Remove Rows with NA in R Data Frame (6 Examples) | Some or All Missing   In this article you'll learn how to remove rows containing missing values in the R programming language . The article consists of six examples for the removal of...

### Remove Rows with NA Using dplyr Package in R (3 Examples)

Remove Rows with NA Using dplyr Package in R (3 Examples)   This article explains how to delete data frame rows containing missing values in R programming . The content of the post is structured like this: Let's dive right in!   Example...

### Remove Vertical or Horizontal Gridlines in ggplot2 Plot in R (2 Examples)

Remove Vertical or Horizontal Gridlines in ggplot2 Plot in R (2 Examples)   In this R tutorial you'll learn how to delete lines in a ggplot2 background grid . The page will consist of these topics: Let's dig in!   Example...

### Remove Working Directory Using R (Example)

Remove Working Directory Using R (Example)   In this R programming tutorial you'll learn how to delete folders . Table of contents: Let's do this!   Exemplifying Working Directory Consider the following working directory:     Our...

### Rename Data Object in R (2 Examples)

Rename Data Object in R (2 Examples)   In this article, I'll show how to change the name of a data object in the R programming language . Table of contents: Let's dive right into the examples!   Introduction of Example...

### Rename Files Using R (Example)

Rename Files Using R (Example)   In this tutorial you'll learn how to change file names of the files in a working directory on your computer in R . The content looks as follows: So now the part you have been waiting for - the tutorial! Example...

### Rename List Elements in R (2 Examples)

Rename List Elements in R (2 Examples)   In this R programming tutorial you'll learn how to modify the names of lists . Table of contents: Let's dig in...   Creation of Example Data We use the following data as basement...

### Reorder Boxplot in R (2 Examples)

Reorder Boxplot in R (2 Examples)   In this post you'll learn how to specify the ordering of a boxplot manually in R . The article will contain these contents: Let's take a look at some R codes in action.   Example Data...

### Reorder Columns of Data Frame in R (4 Examples)

Reorder Columns of Data Frame in R (4 Examples)   In this tutorial, I'll explain how to manually order the variables of a data frame in the R programming language . The tutorial will contain these topics: Creation of Example Data...

### Reorder Facets in ggplot2 Plot in R (Example)

Reorder Facets in ggplot2 Plot in R (Example)   This tutorial illustrates how to fix the ordering of facets in a ggplot2 graph in R . The content of the tutorial is structured as follows: Here's the step-by-step process...   Example...

### Reorder Levels of Factor without Changing Order of Values in R (Example)

Reorder Levels of Factor without Changing Order of Values in R (Example)   In this article you'll learn how to reorder factor levels in the R programming language . The tutorial looks as follows: Introduction of Example Data Example:...

### rep Function in R (3 Examples)

rep Function in R (3 Examples)   In this R tutorial you'll learn how to replicate elements of a vector or list using the rep function . The tutorial will consist of this information: Let's just jump right in. Definition & Basic...

### Repeat Character String N Times in R (2 Examples)

Repeat Character String N Times in R (2 Examples)   In this tutorial, I'll explain how to repeat the elements of a character string multiple times in R programming . The tutorial will contain two examples for the repetition of strings....

### Repeat Rows of Data Frame N Times in R (2 Examples)

Repeat Rows of Data Frame N Times in R (2 Examples)   This tutorial illustrates how to create (multiple) duplicates of each row of a data frame in the R programming language . The article will consist of these contents: Let's do...

### repeat-Loop in R (2 Examples) | Writing & Running repeat-Statements

repeat-Loop in R (2 Examples) | Writing & Running repeat-Statements   In this tutorial, I'll explain how to write and run a repeat-loop in R . The post will consist of the following content blocks: Theoretical Workflow of repeat-Loops...

### Replace 0 with NA in R (Example) | Changing Zero in Data Frame & Vector

Replace 0 with NA in R (Example) | Changing Zero in Data Frame & Vector   In this article, I'll illustrate how to substitute 0 with NA in the R programming language . The tutorial will contain this: Creation of Example Data Example:...

### Replace Blank by NA in R (2 Examples)

Replace Blank by NA in R (2 Examples)   This post shows how to set blank values in a data frame to NA in the R programming language . Table of contents: Let's start right away...   Creating Example Data Consider the...

### Replace Character Value with NA in R (2 Examples)

Replace Character Value with NA in R (2 Examples)   In this tutorial, I'll show how to replace characters in vectors and data frame columns by NA in the R programming language . Table of contents: Let's get started!   Example...

### replace Function in R (Example)

replace Function in R (Example)   This article shows how to exchange values in a vector using the replace function in the R programming language . The tutorial consists of these contents: If you want to learn more about these topics,...

### Replace Inf with NA in Vector & Data Frame in R (Example)

Replace Inf with NA in Vector & Data Frame in R (Example)   In this R tutorial you'll learn how to clean Inf values from your data . The article is structured as follows: Example 1: Replace Inf by NA in Vector Example 2: Replace...

### Replace Missing Values by Column Mean in R (3 Examples)

Replace Missing Values by Column Mean in R (3 Examples)   In this R tutorial you'll learn how to substitute NA values by the mean of a data frame variable . The content of the post is structured as follows: Let's get started...   Creation...

### Replace Multiple Letters with Accents in R (Example)

Replace Multiple Letters with Accents in R (Example)   In this tutorial you'll learn how to exchange special characters with accents in the R programming language . The article contains this: Let's dive into it:   Creating...

### Replace NA with Last Observed Value in R (Example)

Replace NA with Last Observed Value in R (Example)   In this R tutorial you'll learn how to replace NAs with the previous non-NA value . Table of contents: Creation of Example Data Example: Replace NA with latest non-NA Value in...

### Replace Negative Values by Zero in R (2 Examples)

Replace Negative Values by Zero in R (2 Examples)   In this R tutorial you'll learn how to set negative values to zero . Table of contents: Here's how to do it:   Example 1: Replace Negative Values in Vector by Zero In...

### Replace Particular Value in Data Frame in R (2 Examples)

Replace Particular Value in Data Frame in R (2 Examples)   This tutorial explains how to change particular values in a data frame to different values in the R programming language . Table of contents: Introduction of Example Data...

### Replace Spaces in Column Names in R (2 Examples)

Replace Spaces in Column Names in R (2 Examples)   This tutorial shows how to remove blanks in variable names in the R programming language . The content of the page is structured as follows: Let's start right away:   Creation...

### Replace Specific Characters in String in R (4 Examples)

Replace Specific Characters in String in R (4 Examples)   This article illustrates how to exchange a certain character pattern within a string in the R programming language . Table of contents: Let's dive right in...   Example...

### Replace Value of Data Frame Variable Using dplyr Package in R (Example)

Replace Value of Data Frame Variable Using dplyr Package in R (Example)   In this R post you'll learn how to use the dplyr package to change particular values in a data frame column . The table of content is structured as follows: Here's...

### Replace Values in Data Frame Conditionally in R (4 Examples)

Replace Values in Data Frame Conditionally in R (4 Examples)   In this tutorial, I'll show how to exchange specific values in the columns of a data frame based on a logical condition in R . The content of the article looks like this: So...

### Replace Values in Factor Vector or Column in R (3 Examples)

Replace Values in Factor Vector or Column in R (3 Examples)   In this article you'll learn how to replace certain elements or entire levels of a factor in the R programming language . The content looks as follows: You're here for...

### Replace Values in Vector in R (2 Examples)

Replace Values in Vector in R (2 Examples)   In this R programming tutorial you'll learn how to exchange given values in a vector . Table of contents: Let's dive into it...   Creation of Example Data As a first step,...

### Replace X-Axis Values in R (Example) | How to Change & Customize Ticks

Replace X-Axis Values in R (Example) | How to Change & Customize Ticks   In this R tutorial you'll learn how to modify x-axis values manually . The content of the post looks as follows: Creating Example Plot Example: Changing X-Axis...

### Report Missing Values in Data Frame in R (2 Examples)

Report Missing Values in Data Frame in R (2 Examples)   In this R tutorial you'll learn how to illustrate missing data in a data table in an elegant way . Table of contents: Here's the step-by-step process!   Creating...

### Reset par to Default Values in R (Example)

Reset par to Default Values in R (Example)   In this article, I'll show how to set the par options back to default in the R programming language . Table of contents: Let's dive right into the exemplifying R syntax.   Example...

### Reshape Data Frame from Long to Wide Format in R (2 Examples)

Reshape Data Frame from Long to Wide Format in R (2 Examples)   In this R tutorial you'll learn how to convert data frames from long to wide format . The article is structured as follows: Let's dive right in!   Introduction...

### Reshape Data Frame from Wide to Long Format in R (2 Examples)

Reshape Data Frame from Wide to Long Format in R (2 Examples)   In this tutorial, I'll illustrate how to convert a data frame from wide to long format in the R programming language . The post contains the following topics: You're...

### Return Column Name of Largest Value for Each Row in R (Example)

Return Column Name of Largest Value for Each Row in R (Example)   This tutorial illustrates how to find the variables with the largest values in each row in the R programming language . The content of the post looks as follows: Let's...

### Return Data Frame Row Based On Value in Column in R (Example)

Return Data Frame Row Based On Value in Column in R (Example)   This article explains how to select particular rows conditionally in R . Table of contents: It's time to dive into the example!   Creating Example Data The...

### Return Index Position of Element in Matrix Using which() Function in R (Example)

Return Index Position of Element in Matrix Using which() Function in R (Example)   In this tutorial, I'll illustrate how to find the index positions of certain elements in a matrix using the which() function in R . Table of contents: So...

### Return Multiple Objects from User-Defined Function in R (Example)

Return Multiple Objects from User-Defined Function in R (Example)   This tutorial illustrates how to return multiple outputs from a user-defined function in R . The tutorial consists of the following content blocks: Create User-Defined...

### Return Value from R Function (3 Examples)

Return Value from R Function (3 Examples)   This article shows how to apply the return command to produce outputs with user-defined R functions . The article contains three reproducible examples: Example 1: R Function with return Example...

### rev R Function | 3 Examples (Reverse of Vector, Data Frame by Column & by Row)

rev R Function | 3 Examples (Reverse of Vector, Data Frame by Column & by Row)   Basic R Syntax: rev(x)   The rev R function returns a reversed version of a vector or other data objects . The basic R code for the rev command...

### Reverse Axis Limits of Plot in Base R & ggplot2 (2 Examples)

Reverse Axis Limits of Plot in Base R & ggplot2 (2 Examples)   This tutorial demonstrates how to exchange the axis limits of a graphic in the R programming language . Table of contents: Let's get started:   Example Data...

### robustbase Package in R | Tutorial & Programming Examples

robustbase Package in R | Tutorial & Programming Examples   The robustbase R package provides tools that analyze data with robust methods. This includes methodology for model selection and multivariate statistics. Here you can find the...

### Rotate Axis Labels of Base R Plot (3 Examples)

Rotate Axis Labels of Base R Plot (3 Examples)   In this article, I'll explain how to rotate axis labels of a Base R plot in the R programming language . The content of the post is structured as follows: Example Data Example 1:...

### Rotate ggplot2 Axis Labels in R (2 Examples)

Rotate ggplot2 Axis Labels in R (2 Examples)   This article explains how to rotate the axis labels of a ggplot in the R programming language . The article contains the following topics: Creation of Example Data & Basic Plot Example...

### Round Numeric Columns of Data Frame with Character & Factor Variables in R (2 Examples)

Round Numeric Columns of Data Frame with Character & Factor Variables in R (2 Examples)   In this article, I'll explain how to round the digits of a data frame that contains not only numeric variables in the R programming language . Table...

### Round Up to Nearest 10 or 100 in R (Example)

Round Up to Nearest 10 or 100 in R (Example)   In this post, I'll illustrate how to round up to the closest 10 or 100 in R programming . The tutorial will consist of one example for the rounding of data. To be more specific, the tutorial...

### Rounding in R (4 Examples) | round, ceiling, floor, trunc & signif Functions

Rounding in R (4 Examples) | round, ceiling, floor, trunc & signif Functions   This tutorial explains how to round numbers in R with the functions round(), ceiling(), floor(), trunc(), and signif(). The article shows in four examples ...

### Run Multiple Regression Models in for-Loop in R (Example)

Run Multiple Regression Models in for-Loop in R (Example)   In this article, I'll show how to estimate multiple regression models in a for-loop in the R programming language . Table of contents: If you want to know more about these...

### Run R Script within Other Scripts (2 Examples)

Run R Script within Other Scripts (2 Examples)   In this R programming post you'll learn how to include an R script into another script . Table of contents: Let's dig in.   Preparing the Examples We'll use the following...

### sample Function in R (6 Examples)

sample Function in R (6 Examples)   On this page you'll learn how to take a random sample using the sample function in the R programming language . Table of contents: Let's get started... Definition & Basic R Syntax of sample...

### Sample Random Rows of Data Frame in R (2 Examples) | Select with Base R vs. dplyr Package

Sample Random Rows of Data Frame in R (2 Examples) | Select with Base R vs. dplyr Package   This tutorial illustrates how to select random rows in a data frame in the R programming language . The article will consist of the following information: Construction...

### sample_n & sample_frac R Functions | Sample Data with dplyr Package

sample_n & sample_frac R Functions | Sample Data with dplyr Package   This article shows how to take a sample of a data set with the sample_n and sample_frac functions of the dplyr package in the R programming language . The post is structured...

### Save & Load RData Workspace Files in R (3 Examples)

Save & Load RData Workspace Files in R (3 Examples)   This article shows how to save and load data from and to R . In the article, I'll show in three examples how to: Save & Load the Whole Workspace (save.image Function) Save &...

### Save All Console Input & Output to File in R (Example)

Save All Console Input & Output to File in R (Example)   In this tutorial, I'll show how to save the input and output of the RStudio console to a log file in the R programming language . Table of contents: Let's dive right into...

### Save Plot in Data Object in Base R (Example)

Save Plot in Data Object in Base R (Example)   In this tutorial you'll learn how to store a graphic in a data object in R programming . Table of contents: Let's jump right to the example!   Example: Save Graphic in Data...

### Scale Bars of Stacked Barplot to a Sum of 100 Percent in R (2 Examples)

Scale Bars of Stacked Barplot to a Sum of 100 Percent in R (2 Examples)   On this page you'll learn how to convert all bars of a barplot to 100% in R . The article will consist of these topics: Let's dive right in.   Example...

### Scale Data to Range Between Two Values in R (4 Examples)

Scale Data to Range Between Two Values in R (4 Examples)   On this page you'll learn how to convert a vector or data frame column to a range between two points in the R programming language . Table of contents: Let's start right...

### Scatterplot in R (10 Examples) | Create XYplot in Base R, ggplot2 & lattice

Scatterplot in R (10 Examples) | Create XYplot in Base R, ggplot2 & lattice   In this R programming tutorial you'll learn how to draw scatterplots . Table of contents: Exemplifying Data Example 1: Basic Scatterplot in R Example...

### SDMTools Package in R | Tutorial & Programming Examples

SDMTools Package in R | Tutorial & Programming Examples   The SDMTools R package provides tools for the post processing of outcomes of species distribution modeling exercises. Here you can find the documentation of the SDMTools package....

### select & rename R Functions of dplyr Package (2 Examples)

select & rename R Functions of dplyr Package (2 Examples)   In this R tutorial you'll learn how to select and rename variables with the select() and rename() functions of the dplyr package . The tutorial consists of two examples for the...

### Select CRAN Mirror in R (2 Examples) | Manually Specify Repository

Select CRAN Mirror in R (2 Examples) | Manually Specify Repository   In this article, I'll illustrate how to select a repository manually when installing an add-on package in the R programming language . The page contains these topics: Let's...

### Select Data Frame Column Using Character Vector in R (Example)

Select Data Frame Column Using Character Vector in R (Example)   In this R programming tutorial you'll learn how to extract a data frame variable based on a character string . Table of contents: Creating Example Data Example: Select...

### Select Data Frame Columns by Logical Condition in R (2 Examples)

Select Data Frame Columns by Logical Condition in R (2 Examples)   This page illustrates how to extract particular data frame columns based on a logical condition in the R programming language . The content is structured as follows: Let's...

### Select Data Frame Rows based on Values in Vector in R (4 Examples)

Select Data Frame Rows based on Values in Vector in R (4 Examples)   In this tutorial, I'll explain how to extract certain rows according to the values in a vector in the R programming language . Table of contents: You're here for...

### Select Data Frame Rows where Column Values are in Range in R (2 Examples)

Select Data Frame Rows where Column Values are in Range in R (2 Examples)   In this article you'll learn how to extract certain data frame rows within a range of values in the R programming language . Table of contents: So now the...

### Select First Element of Nested List in R (2 Examples)

Select First Element of Nested List in R (2 Examples)   In this article, I'll show how to extract the top of each list element in a nested list in the R programming language . The tutorial will contain two examples for the extraction of...

### Select First Row of Each Group in Data Frame in R (Example)

Select First Row of Each Group in Data Frame in R (Example)   In this article you'll learn how to extract the first data frame row by group in the R programming language . The article consists of the following: Let's dive right...

### Select Last Column of Data Frame in R (2 Examples)

Select Last Column of Data Frame in R (2 Examples)   In this article, I'll explain how to extract the very last variable of a data frame in the R programming language . Table of contents: Let's just jump right in:   Creation...

### Select Multiple Elements from List in R (Example)

Select Multiple Elements from List in R (Example)   This tutorial explains how to use square brackets to extract several list elements in the R programming language . Table of contents: You're here for the answer, so let's get straight...

### Select Odd & Even Rows & Columns from Data Frame in R (4 Examples)

Select Odd & Even Rows & Columns from Data Frame in R (4 Examples)   In this article, I'll explain how to extract odd and even rows and columns from a data frame in the R programming language . Table of contents: Let's jump right...

### Select Only Numeric Columns from Data Frame in R (Example)

Select Only Numeric Columns from Data Frame in R (Example)   In this tutorial, I'll explain how to subset only numeric variables from a data frame in the R programming language . The article consists of these contents: Creation of...

### Select Random Element from List in R (Example)

Select Random Element from List in R (Example)   In this R tutorial you'll learn how to pick a random list element . The post will consist of one example for the random sampling of list items. To be more specific, the content of the post...

### Select Row with Maximum or Minimum Value in Each Group in R (Example) | dplyr vs. data.table Packages

Select Row with Maximum or Minimum Value in Each Group in R (Example) | dplyr vs. data.table Packages   This page explains how to return the highest or lowest values within each group of a data frame in the R programming language . Table...

### Select Rows if Value in One Column is Smaller Than in Another in R (Examples)

Select Rows if Value in One Column is Smaller Than in Another in R (Examples)   This tutorial shows how to subset rows if the value in variable No. 1 is smaller than the value in variable No. 2 in the R programming language . Table of...

### Select Rows with Partial String Match in R (2 Examples)

Select Rows with Partial String Match in R (2 Examples)   In this article you'll learn how to filter rows where a specific column has a partial string match in the R programming language . Table of contents: Let's do this:   Creation...

### Select Second to Last Columns of Data Frame in R (2 Examples)

Select Second to Last Columns of Data Frame in R (2 Examples)   In this tutorial, I'll show how to remove the first column of a data frame in the R programming language . Table of contents: Let's take a look at some R codes in action!   Creation...

### Select Subset of Data Table Columns in R (Example)

Select Subset of Data Table Columns in R (Example)   In this article, I'll illustrate how to extract certain variables from a data.table in R . Table of contents: Let's take a look at some R codes in action:   Example...

### Select Top N Highest Values by Group in R (3 Examples)

Select Top N Highest Values by Group in R (3 Examples)   This tutorial explains how to extract the N highest values within each group of a data frame column in the R programming language . Table of contents: Let's dive into it!   Creation...

### seq Function in R (5 Examples)

seq Function in R (5 Examples)   In this tutorial you'll learn how to generate a sequence of numbers using the seq function in the R programming language . The article looks as follows: Let's get started. Definition & Basic R...

### Sequence of Alphabetical Character Letters from A-Z in R (3 Examples)

Sequence of Alphabetical Character Letters from A-Z in R (3 Examples)   In this R tutorial you'll learn how to generate a sequence of character letters . The post will consist of this content: Let's dive right into the examples...   Example...

### Set Area Margins of ggplot2 Plot in R (Example)

Set Area Margins of ggplot2 Plot in R (Example)   In this R programming tutorial you'll learn how to change the area margins of a ggplot2 graph . Table of contents: You're here for the answer, so let's get straight to the exemplifying...

### Set Axis Breaks of ggplot2 Plot in R (3 Examples)

Set Axis Breaks of ggplot2 Plot in R (3 Examples)   In this R programming tutorial you'll learn how to change the axis tick marks of a ggplot2 graphic . The tutorial will consist of the following content: It's time to dive into...

### Set Axis Limits in ggplot2 R Plot (3 Examples)

Set Axis Limits in ggplot2 R Plot (3 Examples)   This tutorial explains how to set the axis limits of a ggplot in the R programming language . The article consists of the following contents: Creation of Example Data & Basic Plot...

### Set Axis Limits of ggplot2 Facet Plot in R (4 Examples) | Using facet_wrap & scales

Set Axis Limits of ggplot2 Facet Plot in R (4 Examples) | Using facet_wrap & scales   This page shows how to manipulate the axis limits of a ggplot2 facet plot in R programming . Table of contents: Creation of Exemplifying Data Example...

### Set Axis Limits of Plot in R (3 Examples)

Set Axis Limits of Plot in R (3 Examples)   In this tutorial, I'll explain how to change x-axis and y-axis limits in the R programming language . The article is structured as follows: With that, let's do this!   Creation...

### Set Column Names when Using cbind Function in R (2 Examples)

Set Column Names when Using cbind Function in R (2 Examples)   In this R tutorial you'll learn how to rename columns when using the cbind function . The article consists of these content blocks: Let's get started!   Creation...

### Set ggplot2 Axis Limit Only on One Side in R (Example)

Set ggplot2 Axis Limit Only on One Side in R (Example)   In this R programming tutorial you'll learn how to define only the lower or upper bound of a ggplot2 axis limit . The tutorial is structured as follows: So now the part you...

### Set Legend Alpha of ggplot2 Plot in R (Example)

Set Legend Alpha of ggplot2 Plot in R (Example)   In this R tutorial you'll learn how to adjust the transparency of ggplot2 legend items . The article consists of one example for the modification of alpha values. More precisely, the tutorial...

### Set NA to Blank in R (2 Examples)

Set NA to Blank in R (2 Examples)   In this article, I'll explain how to replace NA with blank values in the R programming language . Table of contents: Let's take a look at some R codes in action.   Example 1: Replace...

### Set Number of Bins for Histogram in R (2 Examples)

Set Number of Bins for Histogram in R (2 Examples)   In this article you'll learn how to change the width of bins of a histogram in the R programming language . The content of the tutorial is structured as follows: Let's dive right...

### Set Origin of ggplot2 Plot Axes to Zero in R (Example)

Set Origin of ggplot2 Plot Axes to Zero in R (Example)   In this tutorial you'll learn how to force the axes of a ggplot2 plot to start at zero in the R programming language . Table of contents: If you want to learn more about these...

### Set Working Directory to Source File Location Automatically vs. Manually in RStudio (2 Examples)

Set Working Directory to Source File Location Automatically vs. Manually in RStudio (2 Examples)   In this R post you'll learn how to set the R working directory to the source file location (i.e. the folder where your currently used R file...

### setNames vs. setnames in R (+ Examples) | stats & data.table Package

setNames vs. setnames in R (+ Examples) | stats & data.table Package   In this R tutorial, I'll show you how to apply the setNames function of the R package stats and the setnames function of the R package data.table. The two functions are...

### Shapiro-Wilk Normality Test in R (Example)

Shapiro-Wilk Normality Test in R (Example)   In this tutorial, I'll explain how to perform a Shapiro-Wilk normality test in the R programming language . The table of content looks as follows: Let's do this.   Construction...

### Show ggplot2 Legend at the Bottom of a Plot & Horizontally Aligned in R (Example)

Show ggplot2 Legend at the Bottom of a Plot & Horizontally Aligned in R (Example)   On this page, I'll explain how to display a ggplot2 legend at the bottom of a plot with horizontal alignment in the R programming language . The article...

### sign Function in R (Example)

sign Function in R (Example)   In this R tutorial you'll learn how to find out if a numeric value is positive or negative . The post looks as follows: Here's how to do it. Definition & Basic R Syntax of sign Function   Definition:...

### Simulate Bivariate & Multivariate Normal Distribution in R (2 Examples)

Simulate Bivariate & Multivariate Normal Distribution in R (2 Examples)   This post explains how to draw a random bivariate and multivariate normal distribution in the R programming language . Table of contents: Example 1: Bivariate...

### Skip for-Loop to Next Iteration in R (Example)

Skip for-Loop to Next Iteration in R (Example)   In this article you'll learn how to stop the currently running iteration of a loop and move on to the next iteration in the R programming language . The article consists of one example for...

### slice R Function of dplyr Package (Example)

slice R Function of dplyr Package (Example)   In this tutorial you'll learn how to extract certain rows of a data set with the slice function of the dplyr package in the R programming language . The article will contain these contents: Creation...

### Solve System of Equations in R (3 Examples) | Using solve() Function

Solve System of Equations in R (3 Examples) | Using solve() Function   In this article, I'll explain how to solve a system of equations using the solve() function in the R programming language . Table of contents: Let's get started.   Example...

### Sort Data Frame by Multiple Columns in R (3 Examples)

Sort Data Frame by Multiple Columns in R (3 Examples)   This tutorial illustrates how to order a data frame by multiple columns in the R programming language . I will show you three example codes for the sorting of data frames . More...

### Sort Data Frame in R (4 Examples)

Sort Data Frame in R (4 Examples)   This article explains how to sort a data frame in the R programming language . I will show you four different examples for the ordering of data frames. More precisely, the tutorial will contain the...

### Sort Matrix According to First Column in R (Example)

Sort Matrix According to First Column in R (Example)   In this article, I'll illustrate how to order a matrix by its first variable in the R programming language . The table of content is structured as follows: You're here for the...

### Sort Variables of Data Frame by Column Names in R (2 Examples)

Sort Variables of Data Frame by Column Names in R (2 Examples)   In this R tutorial you'll learn how to order variables of a data matrix by column names . The tutorial will consist of the following topics: Let's jump right to the...

### Sort Vector Based on Values of Another in R (Example)

Sort Vector Based on Values of Another in R (Example)   In this article, I'll show how to sort a vector according to the values of another vector in the R programming language . The tutorial contains the following information: Creation...

### sort, order & rank R Functions | 6 Examples: Data Table, List & by Group Column

sort, order & rank R Functions | 6 Examples: Data Table, List & by Group Column   This article explains how to sort data in R with the functions sort(), order(), and rank(). The tutorial shows in six examples how the different sorting...

### Specify Column Names for X & Y when Joining with dplyr Package in R (Example)

Specify Column Names for X & Y when Joining with dplyr Package in R (Example)   This article explains how to define variable names for both data frames in a dplyr join in the R programming language . Table of contents: Let's just...

### Specify Multiple Arguments in apply Functions in R (Example)

Specify Multiple Arguments in apply Functions in R (Example)   In this tutorial you'll learn how to pass several parameters to the family of apply functions in the R programming language . The page will consist of this information: Here's...

### Specify Reference Factor Level in Linear Regression in R (Example)

Specify Reference Factor Level in Linear Regression in R (Example)   In this article, I'll explain how to change the reference category of a factor variable in a linear regression in R . The content of the page looks like this: Creation...

### Specify Row Names when Reading a File in R (Example)

Specify Row Names when Reading a File in R (Example)   In this tutorial, I'll illustrate how to manually set a specific column of imported data as row names in the R programming language . The content of the page looks as follows: Let's...

### split & unsplit Functions in R (2 Examples)

split & unsplit Functions in R (2 Examples)   In this R tutorial you'll learn how to divide (and reassemble) vectors into groups using the split function . The tutorial is structured as follows: Let's dig in: Definitions & Basic...

### Split Character String at Whitespace in R (2 Examples)

Split Character String at Whitespace in R (2 Examples)   In this R tutorial you'll learn how to split character strings by spaces . Table of contents: Let's just jump right in:   Introduction of Example Data To start...

### Split Character String into Chunks in R (2 Examples)

Split Character String into Chunks in R (2 Examples)   In this tutorial you'll learn how to cut a character string into multiple pieces in the R programming language . The page contains these contents: Let's get started!   Creation...

### Split Code Over Multiple Lines in R (3 Examples)

Split Code Over Multiple Lines in R (3 Examples)   In this post, I'll illustrate how to write long code over several lines in the R programming language . The post will contain this content: Let's start right away.   Example...

### Split Data Frame in R (3 Examples) | Divide (Randomly) by Row & Column

Split Data Frame in R (3 Examples) | Divide (Randomly) by Row & Column   In this R tutorial you'll learn how to separate a data frame into two different parts . The content of the tutorial is structured as follows: Here's how to...

### Split Data Frame into Custom Bins in R (Example)

Split Data Frame into Custom Bins in R (Example)   In this article, I'll show how to divide data frames into custom bins in the R programming language . Table of contents: It's time to dive into the exemplifying R code.   Creating...

### Split Data Frame into List of Data Frames Based On ID Column in R (Example)

Split Data Frame into List of Data Frames Based On ID Column in R (Example)   In this tutorial, I'll explain how to separate a large data frame into a list containing multiple data frames in R . The article looks as follows: Let's...

### Split Data Frame Variable into Multiple Columns in R (3 Examples) | Separate Character String Based on Delimiter

Split Data Frame Variable into Multiple Columns in R (3 Examples) | Separate Character String Based on Delimiter   In this tutorial, I'll illustrate how to separate one variable of a data frame into multiple columns in R . The article...

### Split Data into Train & Test Sets in R (Example)

Split Data into Train & Test Sets in R (Example)   This article explains how to divide a data frame into training and testing data sets in the R programming language . Table of contents: Let's dive right into the example!   Creation...

### Split Vector into Chunks in R (2 Examples)

Split Vector into Chunks in R (2 Examples)   On this page, I'll show how to divide a vector or array into groups in R . Table of contents: Let's dig in:   Creating Example Data The data below is used as basement for...

### sprintf R Function (6 Example Codes)

sprintf R Function (6 Example Codes)   This article explains how to apply the sprintf() function in R. First, let’s have a look at the basic R syntax and the definition of sprintf:   Basic R Syntax of sprintf: sprintf("%f", x...

### Square Root in R (5 Examples) | Apply sqrt Function in R Studio

Square Root in R (5 Examples) | Apply sqrt Function in R Studio   In this tutorial, I'm going to show you how to calculate the square root in R . The tutorial is mainly based on the sqrt function:   Basic R Syntax: sqrt(x)...

### Standard Deviation in R (3 Examples) | Apply sd Function in R Studio

Standard Deviation in R (3 Examples) | Apply sd Function in R Studio   This tutorial explains how to compute the standard deviation in the R programming language. The article is mainly based on the sd() R function . The basic R syntax...

### Standard Error in R (2 Examples)

Standard Error in R (2 Examples)   This tutorial explains how to compute the standard error of the mean in the R programming language . In the following, I'll show you two different example codes for the computation of the standard error...

### Standardize Data Frame Columns in R (2 Examples) | scale Function

Standardize Data Frame Columns in R (2 Examples) | scale Function   In this tutorial, I'll illustrate how to scale a data frame in R programming . Table of contents: Let's dig in:   Example Data First, we have to...

### stats Package in R | Tutorial & Programming Examples

stats Package in R | Tutorial & Programming Examples   The stats R package provides tools for statistical calculations and the generation of random numbers. Here you can find the CRAN page of the stats package.   Tutorials...

### Stop for-Loop when Warnings Appear in R (Example)

Stop for-Loop when Warnings Appear in R (Example)   In this article, I'll explain how to break a for-loop whenever a warning message occurs in R . Table of contents: Setting Up an Example for-Loop Example: Breaking for-Loop after...

### Stop Running R Code with Keyboard Shortcut (Example)

Stop Running R Code with Keyboard Shortcut (Example)   In this tutorial you'll learn how to interrupt a currently running R script using a keyboard shortcut in R . Table of contents: So now the part you have been waiting for - the...

### Store Results of Loop in Data Frame in R (Example) | Save while- & for-Loops

Store Results of Loop in Data Frame in R (Example) | Save while- & for-Loops   In this article you'll learn how to save the results of a loop in a data frame in R . The article will consist of this information: If you want to learn...

### Store Results of Loop in List in R (Example) | Save Output of while- & for-Loops

Store Results of Loop in List in R (Example) | Save Output of while- & for-Loops   This tutorial illustrates how to save the output of a for-loop in a list object in R programming . Table of contents: Let's jump right to the example!   Example:...

### Store Results of Loop in Vector in R (Example) | Save Output of for-Loop in Array

Store Results of Loop in Vector in R (Example) | Save Output of for-Loop in Array   In this R tutorial you'll learn how to save the output of a for-loop in a vector or array . The article contains the following contents: Here's...

### str_c R Function of stringr Package (3 Example Codes)

str_c R Function of stringr Package (3 Example Codes)   This R tutorial shows how to use the str_c function of the stringr package . Let's first have a look at the basic R syntax and the definition of the str_c function:   Basic...

### str_count Function in R (stringr Package)

str_count Function in R (stringr Package)   In this tutorial you'll learn how to use the str_count function to count the number of matches in a character string in R . The content of the page is structured as follows: Creation of...

### str_detect Function in R (stringr Package)

str_detect Function in R (stringr Package)   In this article you'll learn how to use the str_detect function to detect the presence or absence of a pattern in a character string in R . Table of contents: Creation of Example Data ...

### str_dup Function in R (stringr Package)

str_dup Function in R (stringr Package)   In this R tutorial you'll learn how to use the str_dup function to duplicate and concatenate strings within a character vector . The tutorial will contain this content: Creation of Example...

### str_extract Function in R (stringr Package)

str_extract Function in R (stringr Package)   In this tutorial, I'll explain how to use the str_extract function to extract matching patterns from a character string in the R programming language . Table of contents: Introduction...

### str_flatten Function in R (Example)

str_flatten Function in R (Example)   In this article you'll learn how to flatten a string with the str_flatten function in the R programming language . The article looks as follows: Creation of Exemplifying Data Example: Application...

### str_length Function in R (Example)

str_length Function in R (Example)   This article illustrates how to return the length of a string with the str_length function in the R programming language . The article contains these contents: Example Data Example: Application...

### str_locate & str_locate_all Functions in R (2 Examples)

str_locate & str_locate_all Functions in R (2 Examples)   In this R tutorial you'll learn how to use str_locate and str_locate_all to locate the position of patterns in a character string . Table of contents: Example Data Example...

### str_match & str_match_all Functions in R (2 Examples)

str_match & str_match_all Functions in R (2 Examples)   In this tutorial you'll learn how to apply str_match and str_match_all to extract matched groups from a string in R . The tutorial contains this information: Creation of Example...

### str_order & str_sort Functions in R (2 Examples)

str_order & str_sort Functions in R (2 Examples)   In this article you'll learn how to order or sort a character vector with the str_order and str_sort functions in the R programming language . The table of content is structured as follows: Creation...

### str_remove & str_remove_all Functions in R (Example)

str_remove & str_remove_all Functions in R (Example)   In this R programming tutorial you'll learn how to remove matched patterns in a character string with str_remove and str_remove_all . Table of contents: Constructing Exemplifying...

### str_replace & str_replace_all Functions in R (2 Examples)

str_replace & str_replace_all Functions in R (2 Examples)   In this post you'll learn how to replace matched patterns in character strings with the str_replace and str_replace_all functions in the R programming language . The article contains...

### str_replace_na Function in R Programming (Example)

str_replace_na Function in R Programming (Example)   In this article, I'll show how to replace NA values with str_replace_na in R programming . The post will contain these content blocks: Constructing Example Data Example 1: Default...

### str_split & str_split_fixed Functions in R (2 Examples)

str_split & str_split_fixed Functions in R (2 Examples)   This post illustrates how to use str_split and str_split_fixed to split up a string into pieces in the R programming language . Table of contents: Creation of Exemplifying...

### str_starts & str_ends Functions in R (2 Examples)

str_starts & str_ends Functions in R (2 Examples)   In this article, I'll illustrate how to apply str_starts and str_ends to detect the presence or absence of a pattern at the beginning or end of character strings in the R programming language...

### str_sub R Function of stringr Package (2 Examples)

str_sub R Function of stringr Package (2 Examples)   This R programming tutorial explains how to apply the str_sub function of the stringr package . First, let's have a look at the basic R syntax and the definition of the str_sub function:   Basic...

### str_subset & str_which Functions in R (2 Examples)

str_subset & str_which Functions in R (2 Examples)   This tutorial illustrates how use str_subset to keep only strings matching a pattern or how to apply the str_which function to find positions in a character string in the R programming...

### str_trim Function in R (Example)

str_trim Function in R (Example)   This tutorial illustrates how to use str_trim to trim whitespace from a character string in the R programming language . The content of the article is structured as follows: Creation of Example Data...

### str_trunc Function in R (Example)

str_trunc Function in R (Example)   In this tutorial you'll learn how to truncate character strings with the str_trunc function in the R programming language . Table of contents: Example Data Example: str_trunc Function in R Video,...

### str_wrap Function in R (Example)

str_wrap Function in R (Example)   In this R programming tutorial you'll learn how to apply the str_wrap function to wrap a character string into nicely formatted paragraphs. The content of the post looks as follows: Creation of...

### stringr Package in R | Tutorial & Programming Examples

stringr Package in R | Tutorial & Programming Examples   The stringr R package provides consistent wrappers for the stringi package and therefore simplifies the manipulation of character strings in R. Here you can find the documentation...

### stringsAsFactors Argument of data frame Function in R (2 Examples)

stringsAsFactors Argument of data frame Function in R (2 Examples)   In this tutorial, I'll explain how to apply the stringsAsFactors argument of the data.frame function in R programming . Table of contents: Let's start right away.   Example...

### strptime & strftime in R | 5 Example Codes (How to Set Year, Day, Hour & Time Zone)

strptime & strftime in R | 5 Example Codes (How to Set Year, Day, Hour & Time Zone)   In this article, I’ll explain how to convert characters to time objects (and the other way around). The tutorial is based on two R functions: strptime f...

### strsplit Function in R (3 Examples) | How to Split a Character String

strsplit Function in R (3 Examples) | How to Split a Character String   In this tutorial you'll learn how to split character strings using the strsplit() function in the R programming language . Table of contents: Let's just jump...

### Student t distribution in R (4 Examples) | dt, pt, qt & rt Functions

Student t distribution in R (4 Examples) | dt, pt, qt & rt Functions   This article shows how to apply the Student t functions in R . The tutorial is structured as follows: Example 1: Student t Probability Density Function (dt Function)...

### Studentized Range Distribution in R (2 Examples) | ptukey & qtukey Functions

Studentized Range Distribution in R (2 Examples) | ptukey & qtukey Functions   In this tutorial, I'll explain how to apply the Studentized Range distribution functions in R . Table of contents: Example 1: Studentized Range Cumulative...

### sub & gsub R Functions (2 Examples) | Replace One or Multiple Patterns

sub & gsub R Functions (2 Examples) | Replace One or Multiple Patterns   This article explains how to replace pattern in characters in the R programming language . The tutorial is based on the R functions sub() and gsub(). Let's first...

### Subset Data Frame and Matrix by Row Names in R (2 Examples)

Subset Data Frame and Matrix by Row Names in R (2 Examples)   In this article, I'll show how to select certain observations based on row names in the R programming language . The article contains the following content blocks: Let's...

### Subset Data Frame Between Two Dates in R (Example)

Subset Data Frame Between Two Dates in R (Example)   In this R post you'll learn how to select data frame rows in a particular date range . The article will contain the following information: Let's do this:   Creating...

### Subset Data Frame Rows Based On Factor Levels in R (2 Examples)

Subset Data Frame Rows Based On Factor Levels in R (2 Examples)   On this page, I'll show how to select certain data frame rows based on the levels of a factor column in the R programming language . The tutorial is structured as follows: Let's...

### Subset Data Frame Rows by Logical Condition in R (5 Examples)

Subset Data Frame Rows by Logical Condition in R (5 Examples)   In this tutorial you'll learn how to subset rows of a data frame based on a logical condition in the R programming language . Table of contents: Creation of Example Data...

### Substitute Data Frame Row Names by Values in Vector in R (2 Examples)

Substitute Data Frame Row Names by Values in Vector in R (2 Examples)   On this page you'll learn how to replace the row names of a data frame by the values in a vector in the R programming language . The article consists of the following...

### Sum Across Multiple Rows & Columns Using dplyr Package in R (2 Examples)

Sum Across Multiple Rows & Columns Using dplyr Package in R (2 Examples)   In this R tutorial you'll learn how to calculate the sums of multiple rows and columns of a data frame based on the dplyr package . The article contains the following...

### Sum by Group in R (2 Examples)

Sum by Group in R (2 Examples)   In this article, I'll explain how to compute the sum by group in the R programming language . I'll show two different alternatives including reproducible R codes. More precisely, this tutorial contains...

### sum Function in R (3 Examples)

sum Function in R (3 Examples)   In this tutorial you'll learn how to compute the sum in R . The article is mainly based on the sum() function. Let's have a look at the basic R syntax and the definition of the sum function:   Basic...

### Sum of Two or Multiple Data Frame Columns in R (2 Examples)

Sum of Two or Multiple Data Frame Columns in R (2 Examples)   In this article you'll learn how to compute the sum across two or more columns of a data frame in the R programming language . Table of contents: Let's dive into it!   Example...

### Summarize Multiple Columns of data.table by Group in R (Example)

Summarize Multiple Columns of data.table by Group in R (Example)   In this R tutorial you'll learn how to group the variables of a data.table . The tutorial will contain these contents: Here's how to do it...   Example...

### summary Function in R (3 Examples)

summary Function in R (3 Examples)   This article shows how to compute descriptive statistics using the summary function in the R programming language . Table of contents: If you want to learn more about these content blocks, keep...

### Sums of Rows & Columns in Data Frame or Matrix in R (2 Examples)

Sums of Rows & Columns in Data Frame or Matrix in R (2 Examples)   In this tutorial, I'll illustrate how to calculate row and column sums in the R programming language . Table of contents: With that, let's dive right into the exemplifying...

### Suppress Output of Command in R (Example)

Suppress Output of Command in R (Example)   In this R tutorial you'll learn how to disable the output of a command or function . The tutorial contains these content blocks: Let's do this...   Creating Example Data First,...

### Suppress Warnings Globally in R (Example)

Suppress Warnings Globally in R (Example)   In this R tutorial you'll learn how to disable warning messages in the global options . Table of contents: Example: Disable Warning Messages in R Set Global Options to Default Video...

### switch Statement in R (2 Examples) | How to Use the switch() Function

switch Statement in R (2 Examples) | How to Use the switch() Function   In this tutorial, I'll illustrate how to apply the switch statement in R . The content of the page is structured like this: Let's dig in: Definition & Basic...

### Test for Equality of All Vector Elements in R (2 Examples)

Test for Equality of All Vector Elements in R (2 Examples)   In this R tutorial you'll learn how to check whether all elements of a vector object are the same . The content of the post is structured as follows: Let's dive into it.   Construction...

### Test if Character is in String in R (2 Examples)

Test if Character is in String in R (2 Examples)   This tutorial illustrates how to identify whether a character is contained in a string in the R programming language . The content of the article looks as follows: Let's dive right...

### Test If List Element Exists in R (3 Examples)

Test If List Element Exists in R (3 Examples)   In this article, I'll show how to check whether a list element exists in R programming . Table of contents: Creation of Example Data Example 1: Test If List Element Exists with %in%-Operator...

### Test if Vector Contains Given Element in R (Example)

Test if Vector Contains Given Element in R (Example)   This tutorial explains how to test if a vector contains a certain element in R . I will show a step by step example, which is structured as follows: Create Example Vector Check...

### The all & any R Functions | 4 Example Codes

The all & any R Functions | 4 Example Codes   In this tutorial, I'll show you how to use the all and any R functions. I'm going to combine both functions in this article, since the R syntax and the usage of the two functions are basically...

### The difftime R Function | 3 Examples (Return Time Difference in Days, Seconds or Weeks)

The difftime R Function | 3 Examples (Return Time Difference in Days, Seconds or Weeks)   Basic R Syntax: difftime(time_1, time_2)   The difftime R function calculates the time difference of two date or time objects . The...

### The dim Function in R (4 Examples)

The dim Function in R (4 Examples)   Basic R Syntax: dim(data)   The dim function of the R programming language returns the dimension (e.g. the number of columns and rows) of a matrix, array or data frame. Above, you can see...

### The get Function in R (5 Examples)

The get Function in R (5 Examples)   In this article, I'll show you how to use the get function in R . Let's first have a look at the basic R syntax and the definition of the get function:   Basic R Syntax: get("x")   Definition:...

### The is.null Function in R (4 Examples)

The is.null Function in R (4 Examples)   Basic R Syntax: is.null(x)   The R function is.null indicates whether a data object is of the data type NULL (i.e. a missing value). The function returns TRUE in case of a NULL object...

### The jitter R Function | 3 Example Codes (Basic Application & Boxplot Visualization)

The jitter R Function | 3 Example Codes (Basic Application & Boxplot Visualization)   Basic R Syntax: jitter(x)   The jitter R function adds noise to a numeric vector . Typically, this numeric vector is censored or rounded...

### The length Function in R (3 Examples for Vector, List & String)

The length Function in R (3 Examples for Vector, List & String)   Basic R Syntax: length(x)   The length function returns the length of R objects such as vectors, lists, or strings (find a little trick in Example 3). The R...

### The nchar R Function | 3 Examples (String, Vector & Error: nchar Requires a Character)

The nchar R Function | 3 Examples (String, Vector & Error: nchar Requires a Character)   Basic R Syntax: nchar(x)   The nchar R function counts the number of elements (e.g. letters) of a character object. The basic syntax...

### The ncol Function in R (3 Examples)

The ncol Function in R (3 Examples)   Basic R Syntax: ncol(data)   The ncol R function returns the number of columns of a matrix or data frame. Above, you can find the command for the application of ncol in the R programming...

### The nrow Function in R (4 Examples)

The nrow Function in R (4 Examples)   Basic R Syntax: nrow(data)   The nrow R function returns the number of rows that are present in a data frame or matrix. Above, you can find the R code for the usage of nrow in R. You...

### The pmax and pmin R Functions | 3 Examples (How to Handle Warnings & NA)

The pmax and pmin R Functions | 3 Examples (How to Handle Warnings & NA)   In this tutorial, I will show you how to use the R functions pmax() and pmin() . I'll explain both functions in the same article, since the R syntax of the two functions...

### The segments R Function | 3 Example Codes

The segments R Function | 3 Example Codes   Basic R Syntax: segments(x0 = 1, y0 = 1, x1 = 2, y1 = 2)   The segments R function draws a line segment between two pairs of points . The basic syntax for segments in R is shown above. In...

### The setdiff R Function (3 Example Codes)

The setdiff R Function (3 Example Codes)   Basic R Syntax: setdiff(x, y)   The R function setdiff indicates which elements of a vector or data frame X are not existent in a vector or data frame Y. The previous code illustrates...

### Time Difference Between Dates in Weeks, Days, Hours, Minutes & Seconds in R (5 Examples)

Time Difference Between Dates in Weeks, Days, Hours, Minutes & Seconds in R (5 Examples)   In this article, I'll illustrate how to return the time interval between two Date objects in the R programming language . The tutorial will consist...

### tolower, toupper, casefold & chartr R Functions (3 Examples)

tolower, toupper, casefold & chartr R Functions (3 Examples)   This article explains how to convert characters from upper to lower case or vice versa in R . In the tutorial, I will show examples for the R functions tolower(), toupper(),...

### top_n & top_frac R Functions of dplyr Package (2 Examples)

top_n & top_frac R Functions of dplyr Package (2 Examples)   In this R tutorial you'll learn how to return the upper part of a data set with the top_n and top_frac functions of the dplyr add-on package . The article consists of the following: Creating...

### Transform ggplot2 Plot Axis to log10 Scale in R (Example)

Transform ggplot2 Plot Axis to log10 Scale in R (Example)   This tutorial explains how to convert the axis of a ggplot2 graph to a logarithmic scale in the R programming language . The content of the post is structured as follows: Let's...

### Transparent Scatterplot Points in Base R & ggplot2 (2 Examples)

Transparent Scatterplot Points in Base R & ggplot2 (2 Examples)   In this R tutorial you'll learn how to decrease the alpha of points in an xy-plot using Base R and the ggplot2 package . The post will contain these contents: Let's...

### Transpose Data Frame in R (Example) | Rotate Matrix & Table with t Function

Transpose Data Frame in R (Example) | Rotate Matrix & Table with t Function   In this article, I'll show how to transpose a data matrix in the R programming language . The article will contain the following content blocks: Creation...

### Trim Leading and Trailing Whitespace in R (Example for trimws Function)

Trim Leading and Trailing Whitespace in R (Example for trimws Function)   This tutorial explains how to remove leading and trailing whitespace in the R programming language . The article is mainly based on the trimws() R function. Let's...

### Two Functions with Same Name in Different Packages in R (Example)

Two Functions with Same Name in Different Packages in R (Example)   In this R tutorial you'll learn how to specify the package from which a function should be taken . The tutorial consists of the following information: Let's do...

### type.convert R Function (Example) | Type Conversion in R Programming

type.convert R Function (2 Examples) | Type Conversion in R Programming   In this tutorial you'll learn how to apply the type.convert function in R . Let's have a look at the basic R syntax and the definition of the type.convert function...

### unique Function in R (2 Examples)

unique Function in R (2 Examples)   On this page you'll learn how to remove duplicates from vectors and data frames using the unique function in R . The article contains this information: Here's the step-by-step process. Definition...

### Unique Rows of Data Frame Based On Selected Columns in R (Example)

Unique Rows of Data Frame Based On Selected Columns in R (Example)   This tutorial explains how to extract certain rows of a data frame where specific columns are duplicated in the R programming language . The content looks as follows: Let's...

### unit Function in R (Example) | How to Create a Unit Object with the grid Package

unit Function in R (Example) | How to Create a Unit Object with the grid Package   In this R tutorial you'll learn how to create a unit object using the unit() function of the grid package. The content of the post looks as follows: Let's...

### Unload Package without Restarting R (Example)

Unload Package without Restarting R (Example)   This tutorial explains how to unload a package without restarting R (or RStudio) . The article is structured as follows: Step 1: Install & Load Package in R Step 2: Unload Package...

### Use apply Function Only for Specific Data Frame Columns in R (Example)

Use apply Function Only for Specific Data Frame Columns in R (Example)   In this tutorial you'll learn how to apply a function only to certain variables of a data frame in R programming . Table of contents: Let's dig in:   Creation...

### Use Function in Each Row of Data Frame in R (2 Examples)

Use Function in Each Row of Data Frame in R (2 Examples)   In this article, I'll show how to apply a function to each row of a data frame in the R programming language . Table of contents: Constructing Example Data Example 1: apply()...

### Use of Tilde ~ in R (Example)

Use of Tilde ~ in R (Example)   In this R tutorial you'll learn how to use the tilde symbol (i.e. ~). Table of contents:   Tilde Symbol Explained Generally speaking, the tilde symbol is used within formulas of statistical...

### Use Previous Row of data.table in R (2 Examples)

Use Previous Row of data.table in R (2 Examples)   In this article, I'll show how to select values from the previous row of a data.table in the R programming language . The content of the page is structured as follows: Let's dive...

### Using hjust & vjust to Move Elements in ggplot2 Plots in R (3 Examples)

Using hjust & vjust to Move Elements in ggplot2 Plots in R (3 Examples)   In this R tutorial you'll learn how to apply the hjust and vjust arguments . Table of contents: So without further ado, let's dive right in.   Example...

### Using tryCatch Function to Handle Errors & Warnings in R (3 Examples)

Using tryCatch Function to Handle Errors & Warnings in R (3 Examples)   In this article you'll learn how to debug R codes using the tryCatch function in the R programming language . The tutorial will consist of this content: Let's...

### Variance in R (3 Examples) | Apply var Function with R Studio

Variance in R (3 Examples) | Apply var Function with R Studio   This tutorial shows how to compute a variance in the R programming language . The article is mainly based on the var() function. The basic R syntax and the definition of var...

### Venn Diagram with Opacity in R (2 Examples)

Venn Diagram with Opacity in R (2 Examples)   In this R tutorial you'll learn how to create a venn diagram with transparent colors . Table of contents: It's time to dive into the exemplifying R syntax.   Example 1: Venn...

### Venn Diagram with Proportional Size in R (2 Examples)

Venn Diagram with Proportional Size in R (2 Examples)   This tutorial shows how to draw a venn diagram with proportional size in the R programming language . The article will consist of two examples for the drawing of venn diagrams. To...

### Vincenty Ellipsoid Great Circle Distance in R (Example)

Vincenty Ellipsoid Great Circle Distance in R (Example)   In this article, I'll show how to compute a Vincenty ellipsoid great circle distance in R . The tutorial consists of the following content: Let's dive right in!   Creating...

### Vincenty Sphere Great Circle Distance in R (Example)

Vincenty Sphere Great Circle Distance in R (Example)   In this R tutorial you'll learn how to calculate the Vincenty sphere great circle distance . The post will contain this: It's time to dive into the example...   Creation...

### Warning in R: reached getOption("max.print") | How to Increase Limit

Warning in R: reached getOption("max.print") | How to Increase Limit   This page explains how to handle the warning message "reached getOption("max.print") -- omitted X entries" in the R programming language . The article will consist...

### Warning in R: The following objects are masked from package (Example)

Warning in R: The following objects are masked from package (Example)   In this R programming post you'll learn how to deal with the warning message "The following objects are masked from 'package:X'" . The article will consist of this...

### Warning Message in R: argument is not numeric or logical: returning NA

Warning Message in R: argument is not numeric or logical: returning NA   In this R tutorial you'll learn how to handle the warning message: "argument is not numeric or logical: returning NA" . Table of contents: So now the part...

### Warning Message in R: longer object length not multiple of shorter object

Warning Message in R: longer object length not multiple of shorter object   In this article you'll learn how to deal with the warning message "longer object length is not a multiple of shorter object length" in R programming . The post...

### weekdays, months, quarters & julian Functions in R (4 Examples)

weekdays, months, quarters & julian Functions in R (4 Examples)   In this article, I'll explain how to apply the R programming functions weekdays, months, quarters, and julian . Let’s have a look at the basic R syntax and the definition o...

### Weibull Distribution in R (4 Examples) | dweibull, pweibull, qweibull & rweibull Functions

Weibull Distribution in R (4 Examples) | dweibull, pweibull, qweibull & rweibull Functions   In this tutorial you'll learn how to apply the weibull functions in R . Table of contents: Example 1: Weibull Density in R (dweibull Function)...

### Weighted Mean in R (5 Examples)

Weighted Mean in R (5 Examples)   This tutorial explains how to compute the weighted mean in the R programming language . The tutorial is mainly based on the weighted.mean() function. So let's have a look at the basic R syntax and the...

### Weighted Sum in R (Example)

Weighted Sum in R (Example)   This article shows in an R programming example how to compute the weighted sum . First, we need to create some example data in R. I'm going to create one numeric vector containing my observed values... x...

### which Function in R (5 Examples)

which Function in R (5 Examples)   On this page, I'll illustrate how to return index positions of certain values using the which function in R . Table of contents: Let's do this: Definition & Basic R Syntax of which Function   Definition:...

### while-Loop in R (2 Examples) | Writing, Running & Using while-Statement

while-Loop in R (2 Examples) | Writing, Running & Using while-Statement   In this article you'll learn how to write and use while-loops in the R programming language . The page looks as follows: Theoretical Workflow of while-Loops...

### Why & How to Set a Random Seed in R (Example) | set.seed Function Explained

Why & How to Set a Random Seed in R (Example) | set.seed Function Explained   In this R programming tutorial you'll learn how to specify a random seed using the set.seed() function . Table of contents: Let's start right away...   Reasons...

### Wilcoxon Signedank Statistic Distribution in R (4 Examples) | dsignrank, psignrank, qsignrank & rsignrank Functions

Wilcoxon Signedank Statistic Distribution in R (4 Examples) | dsignrank, psignrank, qsignrank & rsignrank Functions   In this tutorial, I'll show how to use the functions of the Wilcoxon Signedank Statistic in the R programming language . Table...

### Wilcoxonank Sum Statistic Distribution in R (4 Examples) | dwilcox, pwilcox, qwilcox & rwilcox Functions

Wilcoxonank Sum Statistic Distribution in R (4 Examples) | dwilcox, pwilcox, qwilcox & rwilcox Functions   This article illustrates how to apply the Wilcoxonank Sum Statistic functions in the R programming language . The table of content...

### with & within Functions in R (2 Examples)

with & within Functions in R (2 Examples)   In this R programming tutorial I'll show you how to use the with and within functions to handle data in R. Let's first have a look at the basic R syntax and the definition of with() and within():   Basic...

### Write & Read Multiple CSV Files Using for-Loop in R (2 Examples)

Write & Read Multiple CSV Files Using for-Loop in R (2 Examples)   In this R tutorial you'll learn how to export and import multiple CSV files using a for-loop . Table of contents: Let's take a look at some R codes in action:   Creation...

### Write Data Frame to SPSS .sav File in R (Example)

Write Data Frame to SPSS .sav File in R (Example)   In this R programming tutorial you'll learn how to save a data frame to an SPSS .sav file . Table of contents: Here's the step-by-step process:   Creation of Example...

### Write Data Frame without Header in R (Example)

Write Data Frame without Header in R (Example)   In this tutorial, I'll show how to export a data frame without column names in R . Table of contents: With that, let's get started...   Creation of Exemplifying Data Consider...

### write Function in R (2 Examples)

write Function in R (2 Examples)   In this R tutorial you'll learn how to write data to files using the write() function . The article will consist of the following: Here's the step-by-step process! Definition & Basic R Syntax...

### Write Lines of Text to TXT File in R (3 Examples)

Write Lines of Text to TXT File in R (3 Examples)   This article explains how to export text lines to an external TXT file in the R programming language . The content of the tutorial is structured as follows: Let's start right away.   Creation...

### Write Model Formula with Many Variables of Data Frame in R (5 Examples)

Write Model Formula with Many Variables of Data Frame in R (5 Examples)   This article illustrates how to write formulas containing many variables in a less time-consuming way in the R programming language . Table of contents: Here's...

### Write xlsx & xls in R (4 Examples) | How to Export Data from R to Excel File

Write xlsx & xls in R (4 Examples) | How to Export Data from R to Excel File   In this article, I'll explain how to write Excel files in R . The tutorial will be based on the write.xlsx function of the xlsx package . So let's first have a...

### X. Prefix in Column Names when Reading Data Frame in R (Example)

X. Prefix in Column Names when Reading Data Frame in R (Example)   In this article you'll learn how to modify the X. prefix when importing data in R programming . Table of contents: Let's dive right into the examples.   Example...

### xlsx Package in R | Tutorial & Programming Examples

xlsx Package in R | Tutorial & Programming Examples   The xlsx R package provides tools that read, write, and format excel files. Here you can find the documentation of the xlsx package. Here you can find the CRAN page of the xlsx...

### Zoom into ggplot2 Plot without Removing Data in R (Example)

Zoom into ggplot2 Plot without Removing Data in R (Example)   In this R tutorial you'll learn how to set axis limits of a ggplot2 plot without removing data points . The post looks as follows: Here's the step-by-step process...   Example...

## The Increasing Popularity of R Programming

Since the R programming language provides features for almost all statistical tasks without any costs for the user, R is rapidly growing since its release. Let’s check some numbers…

Graphic 1: Google Scholar Search Results for R Programming Filtered by Year

## Reasons to Learn R

The pros:

+ R is free

+ R’s popularity is growing – More and more people will use it

+ Almost all statistical methods are available in R

+ New methods are implemented in add-on packages quickly

+ Algorithms for packages and functions are publicly available (transparency and reproducibility)

+ R provides a huge variety of graphical outputs

+ R is very flexible – Essentially everything can be modified for your personal needs

+ R is compatible with all operating systems (e.g. Windows, MAC, or Linux)

+ R has a huge community that is organized in forums to help each other (e.g. stackoverflow)

+ R is fun 🙂

The cons:

– Relatively high learning burden at the beginning (even though it’s worth it)

– No systematic validation of new packages and functions

– No company in the background that takes responsibility for errors in the code (this is especially important for public institutes)

– R is almost exclusively based on programming (no extensive drop-down menus such as in SPSS)

– R can have problems with computationally intensive tasks (only important for advanced users)

You are not sure yet, whether you should learn the R programming language? In that case, I can recommend the following video of the YouTube channel RenegadeThinking. The speaker provides you with many reasons, why it is advisable to learn R.

Please accept YouTube cookies to play this video. By accepting you will be accessing content from YouTube, a service provided by an external third party.

If you accept this notice, your choice will be saved and the page will refresh.

## Appendix

Appendix 1: R code for the creation of Graphic 1

```year <- 2018:2000 # Years   r_gs <- c(21600 * 2, 43300, 43100, 38100, 33200, 29800, # Google Scholar searches 28500, 25500, 22400, 19100, 15900, 12000, 8270, 5930, 3740, 2600, 1980, 1600, 1360)   data <- data.frame(software = rep("R", 19), # Combine data year = year, searches = r_gs)   ggplot(data) + # Create plot geom_point(aes(x = year, y = searches, color = software, shape = software)) + geom_line(aes(x = year, y = searches, color = software)) + theme(legend.title = element_blank(), legend.position = "none") + ggtitle("Google Scholar Search Results") + labs(x = "Year", y = "Search Results") + scale_y_continuous(labels = comma)```

Appendix 2: How to create the header graphic of this page

```par(mar = c(0, 0, 0, 0)) # Remove space around plot par(bg = "#1b98e0") # Set background color   set.seed(10293847) # Seed   N <- 100000 # Sample size x <- rnorm(N) # X variable y <- rnorm(N) + x # Correlated Y variable   plot(x, y, col = "#353436", pch = 19, cex = 0.1 # Create plot , xlim = c(- 4, 4), ylim = c(- 7, 7)) text(0, 0, "R", col = "#1b98e0", cex = 12) # Write R points(0, 0, col = "#1b98e0", cex = 30, lwd = 5) # Create circles points(0, 0, col = "#1b98e0", cex = 50, lwd = 5) points(0, 0, col = "#1b98e0", cex = 70, lwd = 5) points(0, 0, col = "#1b98e0", cex = 90, lwd = 5) points(0, 0, col = "#1b98e0", cex = 110, lwd = 5) box(col="#1b98e0") # Color of box```