| Arms | R Documentation |
Create a class of arm.
Public methods in this R6 class are used in developing this package. Thus, we have to export the whole R6 class which exposures all public methods. However, only the public methods in the list below are useful to end users.
$add_endpoints()
$print()
new()initialize an arm
Arms$new(name, ...)
namename of arm, which is the arm's label in generated data
...subset condition that is compatible with dplyr::filter.
This can be used to specify inclusion criteria of an arm.
By default it is not specified, i.e. all data generated by the generator
will be used as trial data. More than one conditions can be
specified in ....
add_endpoints()add one or multiple endpoints to the arm.
Arms$add_endpoints(...)
...one or more objects returned from endpoint().
a <- arm(name = 'trt')
x <- endpoint(name = 'x', type = 'tte',
generator = rexp) # median = log(2)/1 = 0.7
y <- endpoint(name = 'y', type = 'non-tte', readout = c(y = 0),
generator = rnorm, sd = 1.4, mean = 0.7)
a$add_endpoints(y, x)
## run it in console to see the summary report
a
print(a) # use the print method
get_name()return name of arm.
Arms$get_name()
get_number_endpoints()return number of endpoints in the arm.
Arms$get_number_endpoints()
has_endpoint()check if the arm has any endpoint. Return TRUE or FALSE.
Arms$has_endpoint()
get_endpoints()return a list of endpoints in the arm.
Arms$get_endpoints()
get_endpoints_name()return name of endpoints registered to the arm.
Arms$get_endpoints_name()
generate_data()generate arm data.
Arms$generate_data(n_patients_in_arm)
n_patients_in_arminteger. Number of patients randomized to the arm.
print()print an arm.
Arms$print(categorical_vars = NULL)
categorical_varscharacter vector of categorical variables. This can be used to specify variables with limited distinct (numeric) values as categorical variables in summary report.
clone()The objects of this class are cloneable with this method.
Arms$clone(deep = FALSE)
deepWhether to make a deep clone.
# Instead of using Arms$new(), please use arm(), a user-friendly
# wrapper. See examples in ?arm
## ------------------------------------------------
## Method `Arms$add_endpoints`
## ------------------------------------------------
a <- arm(name = 'trt')
x <- endpoint(name = 'x', type = 'tte',
generator = rexp) # median = log(2)/1 = 0.7
y <- endpoint(name = 'y', type = 'non-tte', readout = c(y = 0),
generator = rnorm, sd = 1.4, mean = 0.7)
a$add_endpoints(y, x)
## run it in console to see the summary report
a
print(a) # use the print method
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.