![]() |
VOOZH | about |
In this article, we will discuss how to merge multiple dataframes in R Programming Language. Dataframes can be merged both row and column wise, we can merge the columns by using cbind() function and rows by using rbind() function
cbind() is used to combine the dataframes by columns.
Syntax:
cbind(data1,data2,..............,data n)
Parameters:
where data1 and data 2 are the data frames.
Example 1:
Output:
👁 ImageExample 2:
We can also merge specific columns in each dataframe by using $ operator we can access the dataframe column
Syntax:
dataframe_name$columnname
Output:
👁 ImageExample 3:
Output:
👁 ImageWe can merge the rows between the dataframes using rbind() function.
Syntax:
rbind(dataframe1,dataframe2)
Example 1:
Output:
👁 ImageExample 2:
Output:
👁 Image