Merge branch 'issue-13' into develop
This commit is contained in:
commit
829bcc447e
3 changed files with 11 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ computeDiffInCounts <- function(rows, max_noalle, nloci, data) {
|
||||||
# % riveill<6C> rows. rows pit<69><74> olla vaakavektori.
|
# % riveill<6C> rows. rows pit<69><74> olla vaakavektori.
|
||||||
|
|
||||||
diffInCounts <- zeros(max_noalle, nloci)
|
diffInCounts <- zeros(max_noalle, nloci)
|
||||||
for (i in seq_len(nrow(data)) ) {
|
for (i in seq_len(nrow(data))) {
|
||||||
row <- data[i, ]
|
row <- data[i, ]
|
||||||
notEmpty <- as.matrix(find(row>=0))
|
notEmpty <- as.matrix(find(row>=0))
|
||||||
|
|
||||||
|
|
@ -13,5 +13,11 @@ computeDiffInCounts <- function(rows, max_noalle, nloci, data) {
|
||||||
diffInCounts[row(notEmpty) + (notEmpty - 1) * max_noalle] + 1
|
diffInCounts[row(notEmpty) + (notEmpty - 1) * max_noalle] + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
diffInCounts <- matrix(
|
||||||
|
data = diffInCounts[!is.na(diffInCounts)],
|
||||||
|
nrow = max_noalle,
|
||||||
|
ncol = nloci,
|
||||||
|
byrow = TRUE
|
||||||
|
)
|
||||||
return(diffInCounts)
|
return(diffInCounts)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ computePopulationLogml <- function(pops, adjprior, priorTerm) {
|
||||||
# Computation #
|
# Computation #
|
||||||
# ======================================================== #
|
# ======================================================== #
|
||||||
isarray <- length(dim(repmat(adjprior, c(1, 1, length(pops))))) > 2
|
isarray <- length(dim(repmat(adjprior, c(1, 1, length(pops))))) > 2
|
||||||
|
# FIXME: 3rd dimension of COUNTS getting dropped
|
||||||
term1 <- squeeze(
|
term1 <- squeeze(
|
||||||
sum(
|
sum(
|
||||||
sum(
|
sum(
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@
|
||||||
\alias{inputdlg}
|
\alias{inputdlg}
|
||||||
\title{Gather user input}
|
\title{Gather user input}
|
||||||
\usage{
|
\usage{
|
||||||
inputdlg(prompt, definput = NULL, dims = 1)
|
inputdlg(prompt, dims = 1, definput = NULL)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{prompt}{Text field with user instructions}
|
\item{prompt}{Text field with user instructions}
|
||||||
|
|
||||||
\item{definput}{default value of the input}
|
|
||||||
|
|
||||||
\item{dims}{number of dimensions in the answwers}
|
\item{dims}{number of dimensions in the answwers}
|
||||||
|
|
||||||
|
\item{definput}{default value of the input}
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Replicates the functionality of the homonymous function in Matlab (sans dialog box)
|
Replicates the functionality of the homonymous function in Matlab (sans dialog box)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue