R/summary.simul.nfac.prior.R

Defines functions summary.simul.nfac.prior

#' @export

summary.simul.nfac.prior <- function(object, ...)
{
  Kmax <- attr(object, 'Kmax')

  comp.freq <- function(x) table(factor(x, levels = 1:Kmax))/length(x)

  acc  <- lapply(object, '[[', 'acc')
  nfac <- lapply(object, '[[', 'nfac')
  nfac <- lapply(nfac, comp.freq)

  out <- list(nfac = nfac, acc = acc)
  class(out) <- 'summary.simul.nfac.prior'
  return(out)
}

Try the BayesFM package in your browser

Any scripts or data that you put into this service are public.

BayesFM documentation built on Nov. 19, 2021, 5:07 p.m.