R/summary.fdt.multiple.R

summary.fdt.multiple <- function (object,
                                  columns=1:6,
                                  round=2, 
                                  format.classes=FALSE,
                                  pattern='%09.3e',
                                  row.names=FALSE,
                                  right=TRUE, ...)
{
  right.tmp  <- as.logical(object[[1]][['breaks']]['right'])

  tnames <- names(object)[names(object)!='call']

  for (i in 1:length(tnames)) {
    res <- object[tnames[i]][[tnames[i]]][['table']]

    res <- cbind(res[, 1],
                 round(res[, 2:6],
                       round))[columns]

    cat(tnames[i], '\n')

    if (format.classes) {
      tmp      <- as.character(res[, 1])
      res[, 1] <- make.fdt.format.classes(tmp,
                                          right.tmp,
                                          pattern)
    }

    names(res) <- c('Class limits',
                    'f', 
                    'rf', 
                    'rf(%)',
                    'cf',
                    'cf(%)')[columns]

    print.data.frame(res,
                     row.names=row.names, 
                     right=right, ...)

    cat('\n')}
}

Try the fdth package in your browser

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

fdth documentation built on Nov. 18, 2023, 1:08 a.m.