Union() & union_all() functions in Dplyr package in R
In this article, we will discuss union() and union_all() functions using Dplyr package in the R programming language.
Dataframes in use:
Example: R program to create data frames with college student data and display them
For both of these functions to work successfully, dplyr package should be installed and imported to the working space.
union() is used to return all the elements when two data frames are combined. It doesn’t repeat duplicate values.
Example: R program to perform union among two dataframes.
This will return all the data from both dataframes. Unlike union, it will return duplicate data also.
Example: R program to perform union_all operation