s-u / fastmatch

Fast hashing functions and replacement of match()
18 stars 7 forks source link

Add %in% analogue #2

Closed joshuaulrich closed 7 years ago

joshuaulrich commented 8 years ago

A question on StackOverlow asked about a faster version of %in% analogous to fastmatch::fmatch for base::match. Since %in% is basically a simple wrapper around match, it would be an easy addition... unless I'm overlooking something.

For example:

`%fin%` <- function(x, table) {
  fmatch(x, table, nomatch = 0L) > 0L
}
s-u commented 8 years ago

Great idea!

joshuaulrich commented 8 years ago

Would you like me to create a PR where I add %fin% to fastmatch.R and update fastmatch.Rd accordingly?