Method 2 : Using cbind() function
If we want to merge more than two dataframes we can use cbind() function and pass the resultant cbind() variable into as.list() function to convert it into list .
Syntax :
cbind( df1 , df2 . df3 , . . . dfn )
Example 1: Merge multiple dataframes in list
R
df = data.frame (name= c ( "karthik" , "chandu" , "nandu" )) df1 = data.frame (branch= c ( "IT" , "CSE" , "CSE" )) df2 = data.frame (company= c ( "TCS" , "Accenture" , "Infosys" )) merg = cbind (df, df1, df2) print ( as.list (merg)) |
Output :
Example 2: Merge multiple dataframes in list
R
df = data.frame (name= c ( "karthik" , "chandu" , "nandu" )) df1 = data.frame (collage_name= c ( "VFSTR" , "VMTW" , "IIT" )) df2 = data.frame (place= c ( "Guntur" , "Hyderabad" , "Kharagpur" )) df3 = data.frame (proper= c ( "yellandu" , "yellandu" , "yellandu" )) merg = cbind (df, df1, df2, df3) print ( as.list (merg)) |
Output :
R – Merge Multiple DataFrames in List
In this article, we will discuss how to merge multiple data frames in the list using R programming language.
Contact Us