10
10
# ' @param y Not used.
11
11
# ' @param add logical. Add density to existing plot.
12
12
# ' @param ... Optional arguments for plotting.
13
- # '
13
+ # ' @return No return value, this function generates a plot in the current graphics device.
14
14
# ' @export
15
15
# ' @details
16
16
# ' Plot ranges are selected by default to show 99% of the density for unbounded distributions.
17
17
# ' The limits can be changed by specifying `xlim = c(lower, upper)`.
18
18
# '
19
19
# ' Colors, line types, and other typical [par()] parameters can be used.
20
- # '
21
20
if (! isGeneric(" plot" )) setGeneric ("plot ", function(x, y, ...) standardGeneric("plot"))
22
21
23
22
@@ -29,7 +28,7 @@ if (!isGeneric("plot")) setGeneric("plot", function(x, y, ...) standardGeneric("
29
28
# ' @aliases get_vars
30
29
# '
31
30
# ' @param object Object
32
- # ' @returns A `character` vector containing variable names
31
+ # ' @return A `character` vector containing variable names
33
32
# ' @export
34
33
# '
35
34
setGeneric ("get_vars ", function(object) standardGeneric("get_vars"))
@@ -57,6 +56,8 @@ setGeneric("mcmc_sample", function(x, ...) standardGeneric("mcmc_sample"))
57
56
# '
58
57
# ' @rdname show_guide
59
58
# '
59
+ # ' @return A `data.frame` showing all simulation scenarios.
60
+ # '
60
61
# ' @export
61
62
# '
62
63
setGeneric ("show_guide ", function(object) standardGeneric("show_guide"))
@@ -68,6 +69,8 @@ setGeneric("show_guide", function(object) standardGeneric("show_guide"))
68
69
# ' @param object `MCMCSimulationResults` object
69
70
# '
70
71
# ' @rdname get_results
72
+ # '
73
+ # ' @return data.frame with simulation results.
71
74
# '
72
75
# ' @export
73
76
# '
@@ -80,6 +83,8 @@ setGeneric("get_results", function(object) standardGeneric("get_results"))
80
83
# ' @param object `MCMCSimulationResults` object
81
84
# '
82
85
# ' @rdname get_cmd_stan_models
86
+ # '
87
+ # ' @return List of lists of `CmdStanModel` objects for each model.
83
88
# '
84
89
# ' @export
85
90
# '
@@ -92,6 +97,8 @@ setGeneric("get_cmd_stan_models", function(object) standardGeneric("get_cmd_stan
92
97
# '
93
98
# ' @rdname generate
94
99
# '
100
+ # ' @return Object of class [`SimDataList`][SimDataList-class].
101
+ # '
95
102
# ' @export
96
103
setGeneric ("generate ", function(x, ...) standardGeneric("generate"))
97
104
@@ -101,8 +108,6 @@ setGeneric("generate", function(x, ...) standardGeneric("generate"))
101
108
# ' @param analysis_object analysis object
102
109
# '
103
110
# ' @rdname trim_rows
104
- # '
105
- # ' @export
106
111
setGeneric ("trim_rows ", function(borrowing_object, analysis_object) standardGeneric("trim_rows"))
107
112
108
113
# ' Trim columns from Data Matrix Based on Borrowing object type
@@ -111,8 +116,6 @@ setGeneric("trim_rows", function(borrowing_object, analysis_object) standardGene
111
116
# ' @param analysis_object analysis object
112
117
# '
113
118
# ' @rdname trim_cols
114
- # '
115
- # ' @export
116
119
setGeneric ("trim_cols ", function(borrowing_object, analysis_object) standardGeneric("trim_cols"))
117
120
118
121
# ' Create alpha string
@@ -121,20 +124,15 @@ setGeneric("trim_cols", function(borrowing_object, analysis_object) standardGene
121
124
# ' @param outcome_object outcome object
122
125
# '
123
126
# ' @rdname create_alpha_string
124
- # '
125
- # ' @export
126
127
setGeneric ("create_alpha_string ", function(borrowing_object, outcome_object) standardGeneric("create_alpha_string"))
127
128
128
129
# ' Create tau string
129
130
# '
130
131
# ' @param borrowing_object borrowing object
131
132
# '
132
133
# ' @rdname create_tau_string
133
- # '
134
- # ' @export
135
134
setGeneric ("create_tau_string ", function(borrowing_object) standardGeneric("create_tau_string"))
136
135
137
-
138
136
# ' Create Stan Code for Model
139
137
# '
140
138
# ' @param borrowing borrowing object
@@ -145,12 +143,26 @@ setGeneric("create_tau_string", function(borrowing_object) standardGeneric("crea
145
143
# ' @return `glue` `character` containing the Stan code for the data block.
146
144
# ' @export
147
145
# ' @examples
148
- # ' anls_obj <- psborrow2:::.analysis_obj(
149
- # ' data_matrix = example_matrix,
150
- # ' outcome = outcome_surv_exponential("time", "cnsr", prior_normal(0, 100)),
151
- # ' borrowing = borrowing_full("ext"),
152
- # ' treatment = treatment_details("trt", prior_normal(0, 100))
153
- # ' )
146
+ # ' anls_obj <- create_analysis_obj(
147
+ # ' data_matrix = example_matrix,
148
+ # ' outcome = outcome_surv_exponential(
149
+ # ' "time",
150
+ # ' "cnsr",
151
+ # ' baseline_prior = prior_normal(0, 1000)
152
+ # ' ),
153
+ # ' borrowing = borrowing_hierarchical_commensurate(
154
+ # ' "ext",
155
+ # ' prior_exponential(.001)
156
+ # ' ),
157
+ # ' treatment = treatment_details(
158
+ # ' "trt",
159
+ # ' prior_normal(0, 1000)
160
+ # ' ),
161
+ # ' covariates = add_covariates(
162
+ # ' covariates = c("cov1", "cov2"),
163
+ # ' priors = prior_normal(0, 1000)
164
+ # ' )
165
+ # ' )
154
166
# ' make_model_string_model(anls_obj@borrowing, anls_obj@outcome, anls_obj)
155
167
setGeneric ("make_model_string_model ", function(borrowing, outcome, analysis_obj) {
156
168
standardGeneric(" make_model_string_model" )
@@ -164,7 +176,7 @@ setGeneric("make_model_string_model", function(borrowing, outcome, analysis_obj)
164
176
# '
165
177
# ' @param x object of type: [BaselineDataList-class]
166
178
# ' @param ... Optional arguments for passed to [data.frame]
167
- # ' @returns A `data.frame`
179
+ # ' @return A `data.frame`
168
180
NULL
169
181
170
182
# ' @title Combine objects in `psborrow2`
173
185
# ' @name c
174
186
# ' @param x object of type: [SimDataList-class]
175
187
# ' @param ... additional objects to combine
176
- # ' @returns A combined object
188
+ # ' @return A combined object
177
189
NULL
178
190
179
191
# ' Get Simulated Data from `SimDataList` object
183
195
# ' @param object `SimDataList` object
184
196
# ' @param index the index of the scenario (see guide with print(`SimDataList`))
185
197
# ' @param dataset the dataset out of `n_datasets_per_param`
186
- # ' @returns Simulated data as a data frame if the index is specified, else as a list
198
+ # ' @return Simulated data as a data frame if the index is specified, else as a list
187
199
# ' @export
188
200
setGeneric ("get_data ", function(object, index = 1, dataset = 1) standardGeneric("get_data"))
189
201
@@ -192,12 +204,12 @@ setGeneric("get_data", function(object, index = 1, dataset = 1) standardGeneric(
192
204
# ' @param object `BaselineObject` object
193
205
# ' @param ... Additional arguments passed to methods
194
206
# ' @param overwrite logical. Overwrite existing transformations?
195
- # ' @returns `BaselineObject` object with transformations
207
+ # ' @return `BaselineObject` object with transformations
196
208
# ' @export
197
209
setGeneric ("set_transformations ", function(object, ..., overwrite = FALSE) standardGeneric("set_transformations"))
198
210
199
211
# ' Get method for Stan model
200
212
# ' @param object `Analysis` object
201
- # ' @returns String containing the Stan model
213
+ # ' @return String containing the Stan model
202
214
# ' @export
203
215
setGeneric ("get_stan_code ", function(object) standardGeneric("get_stan_code"))
0 commit comments