diff --git a/R/computeDiffInCounts.R b/R/computeDiffInCounts.R index 0f906e5..40055d8 100644 --- a/R/computeDiffInCounts.R +++ b/R/computeDiffInCounts.R @@ -4,7 +4,7 @@ computeDiffInCounts <- function(rows, max_noalle, nloci, data) { # % riveill� rows. rows pit�� olla vaakavektori. diffInCounts <- zeros(max_noalle, nloci) - for (i in seq_len(nrow(data)) ) { + for (i in seq_len(nrow(data))) { row <- data[i, ] 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 <- matrix( + data = diffInCounts[!is.na(diffInCounts)], + nrow = max_noalle, + ncol = nloci, + byrow = TRUE + ) return(diffInCounts) } diff --git a/R/computePopulationLogml.R b/R/computePopulationLogml.R index e0f4765..e598e05 100644 --- a/R/computePopulationLogml.R +++ b/R/computePopulationLogml.R @@ -14,6 +14,7 @@ computePopulationLogml <- function(pops, adjprior, priorTerm) { # Computation # # ======================================================== # isarray <- length(dim(repmat(adjprior, c(1, 1, length(pops))))) > 2 + # FIXME: 3rd dimension of COUNTS getting dropped term1 <- squeeze( sum( sum( diff --git a/man/inputdlg.Rd b/man/inputdlg.Rd index 26b8fa1..48c3e4c 100644 --- a/man/inputdlg.Rd +++ b/man/inputdlg.Rd @@ -4,14 +4,14 @@ \alias{inputdlg} \title{Gather user input} \usage{ -inputdlg(prompt, definput = NULL, dims = 1) +inputdlg(prompt, dims = 1, definput = NULL) } \arguments{ \item{prompt}{Text field with user instructions} -\item{definput}{default value of the input} - \item{dims}{number of dimensions in the answwers} + +\item{definput}{default value of the input} } \description{ Replicates the functionality of the homonymous function in Matlab (sans dialog box)