Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausVigo committed Oct 25, 2024
1 parent 67577f5 commit e5999e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/phyDat.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ rbind.phyDat <- function(...){
x <- list(...)
types <- sapply(x, function(x)attr(x, "type"))
l <- sapply(x, function(x)sum(attr(x, "weight")))
has_gaps <- all(sapply(x, has_gap_state))
if(any(l!=l[1]))stop("Alignments have different # of characters!")
if(any(types!=types[1]))stop("Alignments must have same type!")
nam <- lapply(x, names) |> unlist()
Expand All @@ -183,7 +184,9 @@ rbind.phyDat <- function(...){
attr(x[[1]], "levels"))
return(phyDat(res, type="USER", contrast=contrast))
}
phyDat(res, type=types[1])
result <- phyDat(res, type=types[1])
if(has_gaps) result <- gap_as_state(result)
result
}


Expand Down

0 comments on commit e5999e4

Please sign in to comment.