Open EmilBode opened 4 years ago
I've been playing some more, but it seems this error message it only happens with me under Rstudio (1.2.1335) and R 3.6.1. Under other versions, I get the message : attempt to set an attribute on NULL
, which is at least clearer.
Still, I think the best way to resolve this would be to return NA
, as happens when table=character()
And for fmatch.hash
(see other issue as well), returning a table of length-0 in the class of x
I have encountered what I believe is an equivalent error using fastmatch 1.1.0 under R 4.1.1 in RStudio.
'a' %fin% colnames(matrix(1, 1, 1))
gives
Error in "a" %fin% colnames(matrix(1, 1, 1)) : unable to allocate 33554432.00Mb for a hash table
I expect the function to return FALSE
(rather than NA
), to match the behaviour of 'a' %in% colnames(matrix(1, 1, 1))
.
I've noticed that version 1.1.3 of fastmatch has been released and resolves this issue for me. Thanks, @s-u !
As the title says:
fmatch('somevalue', c())
gives me:(I've also seen it with 33554432.00Mb, but anyway it's trying to allocate a nearly infinte amount of memory)
It does work fine with regular length-0 vectors (e.g. giving character(0) instead of c()).