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)
}

Try the intsvy package in your browser

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

intsvy documentation built on May 29, 2024, 7:10 a.m.