fast_is_equal {dataPreparation}R Documentation

Fast checks of equality

Description

Performs quick check if two objects are equal.

Usage

fast_is_equal(object1, object2)

Arguments

object1

An element, a vector, a data.frame, a data.table

object2

An element, a vector, a data.frame, a data.table

Details

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.

Value

Logical (TRUE or FALSE) if the two objects are equals.

Examples

# 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)

[Package dataPreparation version 1.1.1 Index]