Open rossmounce opened 8 years ago
I'm aware this is essentially user error, but I do think this is something that is probably likely to be encountered.
Reproducible example:
oneblank <- readLines("https://gist.githubusercontent.com/rossmounce/39858a08494c46471c71/raw/f2270970025e1184063c4b0c9eeebc1cb48401ca/List%2520with%2520a%2520blank",warn=FALSE)
> head(oneblank)
[1] "Aa" "Aa" "Aaronsohnia" "Narthecium" "" "Abarema"
> zzz <- lookup_table(oneblank,missing_action="NA",by_species=TRUE)
Error in FUN(X[[i]], ...) : subscript out of bounds
Thanks Ross. Even if user error, a more informative error message is warranted.
I accidentally input a 'blank' name in a long list of names (an error which I think users are quite likely to make!).
It would be nice if the lookup_table function could provide a clearer warning about this. Perhaps even print which items in the list are blank OR skip over blank items?