R/my.methods.R

Defines functions summary.intsvy.reg print.intsvy.reg

### Print outcome

print.intsvy.reg <- function(x, ...) {
  if (all(unlist(lapply(x, is.list)))) { 
    out <- lapply(x, function(y) round(y$reg, 2))
  } else {
    out <- round(x$reg, 2)
  }
  print(out)
}

### Summary function

summary.intsvy.reg <- function(object, ...) {
  if (all(unlist(lapply(object, is.list)))) {
    out <- lapply(object, function(y) y$reg)
  } else {
    out <- object$reg  
  }
  return(out)
}
eldafani/intsvy documentation built on March 18, 2024, 7:54 p.m.