R/print.mcp2.R

Defines functions print.mcp2

print.mcp2 <-
function(x,...)
{
  cat("Call:\n")
  print(x$call)
  cat("\n")
  
  df <- x$comp
  gnames1 <- x$fnames[x$comp[,1]]
  gnames2 <- x$fnames[x$comp[,2]]
  rownames(df) <- paste(gnames1, gnames2, sep = " vs. ")
  colnames(df)[1:2] <- paste("Group", 1:2)
  
  if (colnames(df)[7] == "p.crit") {
      sig <- ifelse(x$comp[,6] < x$comp[,7], TRUE, FALSE)
      df <- round(df, 5)
      df <- data.frame(df, sig)
      print(df[,-c(1:2)])
    } else {
      print(as.data.frame(round(df[,-c(1:2)], 5)))
  }
  
  cat("\n")
}

Try the WRS2 package in your browser

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

WRS2 documentation built on March 19, 2024, 3:08 a.m.