all.equal() Function in R
all.equal() Function in R Programming Language is used to test whether the given vectors are nearly equal or not.
where, vector1 is the first input vector and vector2 is the second input vector.
Note:If the vectors are equal it will return TRUE, if they are nearly equal it will return the Mean relative difference.
In this example, we are creating 2 equal vectors with 5 elements each and applying all.equal() and will be getting true value in the R programming language.
In this example, we are creating 2 unequal vectors with 5 elements each and apply all.equal() and getting the mean relative difference accordingly in the R programming language.
 "Mean relative difference: 0.088"