Improved exception handling
This commit is contained in:
parent
e89c51de57
commit
bb44d0cfd4
3 changed files with 6 additions and 4 deletions
|
|
@ -24,6 +24,6 @@ computeAllFreqs2 <- function (noalle, COUNTS = matrix(NA, 0, 0),
|
|||
}
|
||||
prioriAlleelit <- repmat(prioriAlleelit, c(1, 1, npops))
|
||||
counts <- COUNTS + prioriAlleelit
|
||||
allFreqs <- counts / sumCounts
|
||||
allFreqs <- counts / drop(sumCounts)
|
||||
return(allFreqs)
|
||||
}
|
||||
|
|
@ -13,8 +13,8 @@
|
|||
repmat <- function (mx, n) {
|
||||
# Validation
|
||||
if (length(n) > 3) warning("Extra dimensions of n ignored")
|
||||
if (!is(mx, "matrix")) mx <- t(as.matrix(mx))
|
||||
if (length(n) == 1) n <- rep(n, 2)
|
||||
if (!is(mx, "matrix")) mx <- as.matrix(mx)
|
||||
|
||||
# Replicating cols
|
||||
out <- mx_col <- matrix(rep(mx, n[2]), nrow(mx))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue