[read.genalex()]: Detect semicolon-separated files and throw error with correct command #252
Open
Description
If a user reads in a genalex file with semicolons instead of commas, they will get the following error:
Error in if (nrow(gena) != ninds) { :
missing value where TRUE/FALSE needed
In addition: Warning message:
In read.genalex("genalex.csv") : NAs introduced by coercion
This happens in this block:
Lines 213 to 236 in 94c745a
all.info
contains the first two lines of the genalex file, which determines the checks for the number of samples, loci, and populations. If the user uses ;
as a separator in the file, but does not specify sep = ";"
, then all.info remains a two-element vector and ninds
becomes missing:
> all.info
[[1]]
[1] "9;72;5;10;26;20;11;5;;;;;;;;;;;;"
[[2]]
[1] ";;;Pop 1 ;Pop 2 ;Pop 3 ;Pop 4 ;Pop 5 ;;;;;;;;;;;;"