Translated checkLogml() (#3)

This commit is contained in:
Waldir Leoncio 2022-09-15 13:02:32 +02:00
parent 46dc08905a
commit 53bae46397
3 changed files with 29 additions and 1 deletions

View file

@ -48,6 +48,7 @@ importFrom(ape,read.FASTA)
importFrom(matlab2r,blanks)
importFrom(matlab2r,cell)
importFrom(matlab2r,colon)
importFrom(matlab2r,disp)
importFrom(matlab2r,find)
importFrom(matlab2r,inputdlg)
importFrom(matlab2r,isempty)

27
R/checkLogml.R Normal file
View file

@ -0,0 +1,27 @@
checkLogml <- function(priorTerm, adjprior, cliques, separators) {
# tarkistaa logml:n
# global CLIQCOUNTS
# global SEPCOUNTS
# global PARTITION
npops <- length(unique(PARTITION))
cliqcounts <- computeCounts(cliques, separators, npops)$cliqcounts
sepcounts <- computeCounts(cliques, separators, npops)$sepcounts
CLIQCOUNTS <- cliqcounts
SEPCOUNTS <- sepcounts
logml <- computeLogml(adjprior, priorTerm)$logml
spatialPrior <- computeLogml(adjprior, priorTerm)$spatialPrior
disp(
c(
'logml: ',
logml2String(logml),
', spatial prior: ',
logml2String(spatialPrior)
)
)
return(logml)
}

View file

@ -7,6 +7,6 @@
#' Check the "BugReports" field on the package description for the URL.
#' @importFrom matlab2r blanks cell colon find inputdlg
#' isempty isfield isspace max min ones questdlg rand repmat reshape
#' size sortrows squeeze strcmp times zeros
#' size sortrows squeeze strcmp times zeros disp
#' @importFrom stats runif
NULL