# NOT RUN {
myCat.matrix <- function(..., sep=", ") {
cat("A matrix:\n")
cat(..., sep=sep)
cat("\n")
}
myCat.default <- function(..., sep=", ") {
cat(..., sep=sep)
cat("\n")
}
setGenericS3("myCat")
myCat(1:10)
mat <- matrix(1:10, ncol=5)
myCat(mat)
# }
Run the code above in your browser using DataLab