View source: R/fast_functions.r
fast_is_equal | R Documentation |
Performs quick check if two objects are equal.
fast_is_equal(object1, object2)
object1 |
An element, a vector, a data.frame, a data.table |
object2 |
An element, a vector, a data.frame, a data.table |
This function uses exponential search trick, so it is fast for very large vectors, data.frame and data.table. This function is also very robust; you can compare a lot of stuff without failing.
Logical (TRUE or FALSE) if the two objects are equals.
# Test on a character
fast_is_equal("a", "a")
fast_is_equal("a", "b")
# Test on a vector
myVector <- rep(x = "a", 10000)
fast_is_equal(myVector, myVector)
# Test on a data.table
fast_is_equal(tiny_messy_adult, messy_adult)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.