Skip to content
Prev 258052 / 398502 Next

separate and arrange outputs

On Tue, 2011-04-26 at 19:46 +0200, ivan wrote:
You can create a class for your object and then write a "print" method.

Example:

a <- list(a=2, b=c(2,2,2))
class(a) <- "myclass"
print.myclass <- function(x)
{
  print(x[[1]])
  cat("***********\n")
  print(x[[2]])
}

This yields:
[1] 2
***********
[1] 2 2 2

HTH,

Jerome