Closed skanskan closed 7 years ago
Sorry, but I get
> library(fastmatch)
> fmatch(c(1,0,NA),NA)
[1] NA NA 1
Can you, please, supply details on versions (R + fastmatch + OS) and platform?
The latest version of fmatch
in the repository already does what you want. You're probably using the CRAN version.
R> match(c(1, 0, NA_real_), NA_real_)
[1] NA NA 1
R> fastmatch::fmatch(c(1, 0, NA_real_), NA_real_)
[1] NA NA 1
R> packageVersion("fastmatch")
[1] '1.1.0'
Using the version on CRAN:
R> match(c(1, 0, NA_real_), NA_real_)
[1] NA NA 1
R> fastmatch::fmatch(c(1, 0, NA_real_), NA_real_)
[1] NA NA NA
R> packageVersion("fastmatch")
[1] '1.0.4'
I guess it's time to push it to CRAN ;)
OK, now it works, thanks.
Hello.
The reason I use base's %in% or match commands is because it makes easy to match values no matter they are numbers, characters or even NAs.
I specially like the latter one.
But
fmatch(c(1,0,NA),NA) gives NA, NA, NA (useless)
If fastmatch is supposed to improve base::match I think it should mimic it's behaviour with NA.