# 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...

### 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 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 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 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 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 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 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 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 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 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 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 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 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...

### 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 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...

### 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 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...

### 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 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 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 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 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 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 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 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 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 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 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 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 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...

### 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...

### 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...

### 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...

### 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 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 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 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 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 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 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 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 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 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...

### 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 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 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 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 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 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 first step, we'll have to define...

### 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 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 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 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 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...

### 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...

### 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...

### 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...

### 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 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 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...

### 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 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 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...

### 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...

### 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:...

### 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...

### 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 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 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 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 of 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 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 confidence intervals using ggplot2 and plotrix in the R programming language . Table of contents: Let's just jump...

### 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 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: 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 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...

### 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 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...

### 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.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 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 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 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 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 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 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 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 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 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 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 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...

### 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...

### 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...

### 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 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...

### 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 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 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....

### 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...

### 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 ] Error: '\U' used without hex...

### 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...

### 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 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 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 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 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 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 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 (3 Examples)

If Else Statement in R (3 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...

### 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...

### 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 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...

### 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...

### 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 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...

### 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 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 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...

### 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...

### 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...

### 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...

### 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 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 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...

### 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:...

### 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 ...

### 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 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...

### 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...

### 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...

### 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)...

### 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 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 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 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: \$-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: 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: 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: 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)   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: 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: 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: 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 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 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 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 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: NAs Introduced by Coercion (Example)

R Warning Message: NAs Introduced by Coercion (Example)   This article explains how to warning message "NAs introduced by coercion" in the R programming language . The content of the post is structured as follows: Let's dive into...

### 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 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 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 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)   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...

### 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-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 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 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 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 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 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 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...

### 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 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 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 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 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 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 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 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: Example...

### 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 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...

### 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 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...

### 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...

### 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 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 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 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 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 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...

### 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...

### 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 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 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 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...

### 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 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 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...

### 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 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 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...

### 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...

### 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 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...

### 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...

### 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 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...

### 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...

### 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()...

### 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...

### 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...

### 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 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 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...

### 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)```

```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```

Subscribe to my free statistics newsletter