R/print.foldert.R

Defines functions print.foldert

Documented in print.foldert

print.foldert <- function(x, ...) {
  xprint <- list()
  for (tt in names(x))
  {
    if ((nrow(x[[tt]]) > 0)&(ncol(x[[tt]]) > 0))
    {
      isna <- apply(x[[tt]], 1, is.na)
      if (is.vector(isna))
      {
        whichna <- which(isna)
      } else {
        whichna <- which(apply(isna, 2, all))
      }
    } else {
      whichna <- numeric()
    }
    
    if (length(whichna) == 0)
    {
      xprint[[tt]] <- x[[tt]]
    } else {
      xprint[[tt]] <- x[[tt]][-whichna, , drop = FALSE]
    }
  }
  attr(xprint, "times") <- attr(x, "times")
  attr(xprint, "same.rows") <- attr(x, "same.rows")
  
  print(xprint, ...)
  
  return(invisible(x))
}

Try the dad package in your browser

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

dad documentation built on Aug. 30, 2023, 5:06 p.m.