a b/R/displayOptions.R
1
#The DisplayOptions class definition
2
#This object is used to specify the
3
#predict form parameters summary text
4
5
##' Class defining display options for predict from parameter graphs
6
##' @slot Time string displaying the time units
7
##' @slot Title string title to be displayed on the graph
8
##' @slot StartDate if `0' the x-axis is labelled using 0,1,2,...
9
##' if a date is used then the x-axis is labelled with dates 
10
##' @slot Control legend text for control arm
11
##' @slot Exp legend text for experimetal arm
12
##' @slot Trecruit logical in \code{summary} output number recruited
13
##' @slot Tratio logical in \code{summary} output recruitment ratio
14
##' @slot Tacc logical in \code{summary} output recruit details
15
##' @slot Tmedian logical in \code{summary} output control median
16
##' @slot Thr logical in \code{summary} output hazard ratio
17
##' @slot Tcrithr logical in \code{summary} output critical hazard ratio
18
##' @slot text.width numeric in \code{summary} the width for the summary text 
19
##' @slot ShowRec logical. Show the number of subjects recruited at target times
20
##' @slot Dropout logical. Show the drop out details
21
##' @slot atRiskTime string displayin the units of at risk,
22
##' @slot atRiskConversion numeric, factor for converting Time into atRiskTime
23
##' @slot showatRisk logical should the at risk details be output
24
##' @export
25
setClass( "DisplayOptions", 
26
          slots=c( 
27
            Time = "character",
28
            Title = "character",
29
            StartDate = "character",
30
            Control = "character",
31
            Exp = "character",
32
            Trecruit = "logical",
33
            Tratio = "logical",
34
            Tacc = "logical",
35
            Tmedian = "logical",
36
            Thr = "logical",
37
            Tcrithr = "logical",
38
            text.width="numeric",
39
            ShowRec="logical",
40
            Dropout="logical",
41
            atRiskTime = "character",
42
            atRiskConversion="numeric",
43
            showatRisk="logical"),        
44
          prototype = prototype( 
45
            Time = "months",
46
            Title = "Expected Recruitment and Events",
47
            StartDate = "0",
48
            Control = "Control",
49
            Exp = "Experimental",
50
            Trecruit = TRUE, 
51
            Tratio = TRUE, 
52
            Tacc = TRUE, 
53
            Tmedian = TRUE, 
54
            Thr = TRUE,
55
            Tcrithr = TRUE,
56
            text.width=75,
57
            ShowRec=FALSE,
58
            Dropout=TRUE,
59
            atRiskTime = "years",
60
            atRiskConversion=1/12,
61
            showatRisk=FALSE) 
62
)
63
64
##' DisplayOptions constructor
65
##' @param ... parameters passed to new
66
##' @return A new DisplayOptions object
67
##' @seealso \code{\link{DisplayOptions-class}}
68
##' @export
69
DisplayOptions <- function(...){
70
  new("DisplayOptions",...)
71
}