The binding or combining of the rows is very easy with the rbind() function in R.

rbind() stands for row binding. In simpler terms joining of multiple rows to form a single batch. It may include joining two data frames, vectors, and more.

This article will talk about the uses and applications of rbind() function in R programming.

Without wasting much time, let’s roll in to the topic!!!


Syntax of the rbind() function

**rbind(): **The rbind or the row bind function is used to bind or combine the multiple group of rows together.

rbind``(x,x1)

Where:

  • X = the input data.
  • X1 = The data need to be binded.

The idea of binding rows using rbind()

The idea of binding or combing the rows of multiple data frames is highly beneficial in data manipulation.

The below diagram will definitely get you the idea of working the rbind() function.

Rbind In R

You can see that how rows of different data frames will bound/combined by the rbind() function.


Implementing the rbind() function in R

As you know that rbind() function in R used to bind the rows of different groups of data.

In this section, let’s try to construct a simple data frames and bind them using rbind() function.

#creating a data frame

Student_details<-``c``(``"Mark"``,``"John"``,``"Fredrick"``,``"Floyd"``,``"George"``)

Student_class<-``c``(``"High school"``,``"College"``,``"High school"``,``"High school"``,``"College"``)

df1<-``data.frame``(Student_class,Student_details)

df1

#r programming #function

The rbind() function in R - Binding Rows Made Easy
2.00 GEEK