all_equal() function in R Language is used to compare the values between data frames.
all_equal(target, current, check.attributes, check.names)
target: object to compare
current: object to be compared with
check.attributes: If attributes of both be compared
check.names: If names be compared
Example 1: Comparing Equal Data frames
Here in the above code, we have compared equal data frames data1 and data2, and thus the output seems to be “TRUE”.
Example 2: Comparing Unequal dataframes
Rows in x but not y: 1, 2, 3, 4, 5, 6, 8, 9, 10. Rows in y but not x: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
Here in the above code, we compared the unequal data frames data1 and data3, so we got an error explaining what’s wrong in the code.
- Merge Two Data Frames by common Columns in R Programming - merge() Function
- Combine Vectors, Matrix or Data Frames by Columns in R Language - cbind() Function
- Combine Vectors, Matrix or Data Frames by Rows in R Language - rbind() Function
- R - Data Frames
- Manipulate R Data Frames Using SQL
- Comparing Means in R Programming
- Condense Column Values of a Data Frame in R Programming - summarise() Function
- Generate Data sets of same Random Values in R Programming - set.seed() Function
- Convert an Object to Data Frame in R Programming - as.data.frame() Function
- Check if the Object is a Data Frame in R Programming - is.data.frame() Function
- Convert a Data Frame into a Numeric Matrix in R Programming - data.matrix() Function
- Modify Data of a Data Frame with an Expression in R Programming - with() Function
- Generate a set of Sample data from a Data set in R Programming - sample() Function
- Data Wrangling in R Programming - Data Transformation
- Return a Matrix with Lower Triangle as TRUE values in R Programming - lower.tri() Function
- Assigning values to variables in R programming - assign() Function
- Get Indices of Specified Values of an Array in R Programming - arrayInd() Function
- Check if values in a vector are True or not in R Programming - all() and any() Function
- Replace values of a Factor in R Programming - recode_factor() Function
- Calculate the Floor and Ceiling values in R Programming - floor() and ceiling() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.