Firstly, thank you for the excellent package. I just stumbled upon this while using multiread().
When prune.empty = TRUE, any empty files will be dropped before files are returned. I believe this works as intended when an empty file exists. However, when no empty files exists an empty list will be returned, dropping other non-empty files.
An example using the ngram R directory:
> multiread(path = "R", extension = ".R")
named list()
Line 74 looks to be the cause text = text[-which(text == "")].
Works as expected when an empty file (string) is present:
Firstly, thank you for the excellent package. I just stumbled upon this while using
multiread()
.When
prune.empty = TRUE
, any empty files will be dropped before files are returned. I believe this works as intended when an empty file exists. However, when no empty files exists an empty list will be returned, dropping other non-empty files.An example using the ngram R directory:
Line 74 looks to be the cause
text = text[-which(text == "")]
.Works as expected when an empty file (string) is present:
Works not as expected when an empty file (string) is not present:
After the fix, empty files still pruned:
And non-empty files are still returned when no empty files:
Many thanks, Joe