Skip to content
Prev 175701 / 398503 Next

Variable Wildcard Value

Patrick Burns wrote:
this seems a request for a 'match all' value, somewhat the inverse of NA
(~'match nothing').  i could think of this being useful when you want to
check for duplicates, and want to mark that some entries (e.g., the
unknown ones) are irrelevant for the comparison (i.e., they should match
everything):

    identical(c(1, NA), c(1, 2))
    # FALSE

    identical(c(1, NA), c(1, NA))
    # TRUE
    # confusing!

    # hypothetical
    identical(c(1, *), c(1, 2))
    # TRUE
    identical(c(1, *), c(1, NA))
    # TRUE

not sure about the last one, though, since the original post demanded
that is.na(*) == FALSE

i don't claim this would be useful in practice, just speculating.

vQ