equal: Compare two values and test whether they are equal at certain degree
Description
Compare two values and test whether they are equal at certain degreeUsage
equal(x, y, exactly = FALSE, include = FALSE, pattern = FALSE,
dist = NA_integer_, ...)
Arguments
y
source value (can be ignored in list.search expression)
exactly
TRUE to test if x and y are
exactly identical. ... will be passed to identical.
include
TRUE to test if x included in y.
pattern
TRUE to indicate x is a regular expression
pattern and test if y matches that pattern.
... will be passed to grepl.
dist
integer to indicate the maximum string distance
in tolerance and test if x is close to y in the distance.
... will be passed to stringdist::stringdist.
Details
equal() tests if two values are equal in certain sense. By default it
performs atomic equality test (==) between two atomic vectors with
the same mode and length unless any of the additional parameters is specified.
exactly =, include =, pattern =, and dist =
are mutually exlcusive and the former one always has higher priority than
the latter one, that is, if exactly = TRUE is specified then the last
three arguments will be ignored; or if include = TRUE is specified
then the last two arguments will be ignored, etc.