[adegenet-commits] r963 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Oct 6 12:48:49 CEST 2011
Author: jombart
Date: 2011-10-06 12:48:49 +0200 (Thu, 06 Oct 2011)
New Revision: 963
Modified:
pkg/R/sequences.R
Log:
Fixed odd behaviour in alignment2genind pointed out by Ricardo.
Modified: pkg/R/sequences.R
===================================================================
--- pkg/R/sequences.R 2011-09-27 15:33:00 UTC (rev 962)
+++ pkg/R/sequences.R 2011-10-06 10:48:49 UTC (rev 963)
@@ -88,6 +88,13 @@
if(!is.null(x$nam) && length(x$nam)!=N) stop("Inconsistent names in x (length of x$nam and x$seq do not match). ")
+ ## check that na.char does not overide specified exp.char
+ if(!is.null(na.char) && na.char %in% exp.char){
+ na.char <- na.char[!na.char %in% exp.char]
+ if(length(na.char)==0) na.char <- NULL
+ }
+
+
## convert alignment to matrix of characters
mat <- sapply(x$seq, s2c, USE.NAMES=FALSE)
if(nrow(mat)!=x$nb){
More information about the adegenet-commits
mailing list