R/print.predict.parfm.R

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
################################################################################
#  Print method for class 'predict.parfm'                                      #
################################################################################
#                                                                              #
#  This function prints the objects of class 'predict.parfm'                   #
#                                                                              #
#  Its parameters are                                                          #
#   - x         : the object of class 'select.parfm'                           #
#   - digits    : number of significant digits                                 #
#   - na.prints : character string indicating NA values in printed output      #
#                                                                              #
#                                                                              #
#   Date: January, 10, 2012                                                    #
#                                                                              #
################################################################################

print.predict.parfm <- function(x,
                                digits=3,
                                na.print="",
                                ...) {
  if (!is.null(x)){
    frailty <- attr(x, "frailty")
    dist <- attr(x, "dist")
    cat(paste(toupper(substr(frailty, 1, 1)), substr(frailty, 2, 100), 
                    " frailty model with ", 
                    toupper(substr(dist, 1, 1)), substr(dist, 2, 100),
                    " baseline\n", sep="", collapse=""))
    
    toprint <- as.matrix(cbind(names(x), round(as.vector(x), digits)))
      colnames(toprint) <- c(attr(x, "clustname"), "frailty")
      rownames(toprint) <- rep("", nrow(toprint))
    print(toprint, quote=FALSE)
  } 
}

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.