Learn R Programming

dataPreparation (version 0.1)

fastIsEqual: Fast checks of equality

Description

Performs quick check if two objects are equal

Usage

fastIsEqual(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

Value

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

Details

This function 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.

Examples

Run this code
# NOT RUN {
# Test on a character
fastIsEqual("a", "a")
fastIsEqual("a", "b")

# Test on a vector
myVector <- rep(x = "a", 10000)
fastIsEqual(myVector, myVector)

# Test on a data.table
fastIsEqual(messy_adult, messy_adult)
# }

Run the code above in your browser using DataLab