In dplyr, which function combines two data frames horizontally?

  • bind_rows()
  • cbind()
  • combine()
  • merge()
In dplyr, the bind_rows() function is used to combine two data frames horizontally. It stacks the rows of the second data frame below the first, assuming the columns have the same names and types. merge() is used for more complex merging, and cbind() is a base R function for column binding. combine() is not a valid function in this context.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *