Returns the R source command of a result object.
Usage
rcmd(
obj,
...,
leadingArguments = NULL,
includeDefaultParameters = FALSE,
stringWrapParagraphWidth = 90,
prefix = "",
postfix = "",
stringWrapPrefix = "",
newArgumentValues = list(),
tolerance = 1e-07,
pipeOperator = c("auto", "none", "magrittr", "R"),
output = c("vector", "cat", "test", "markdown", "internal"),
explicitPrint = FALSE,
showVersus = FALSE
)
getObjectRCode(
obj,
...,
leadingArguments = NULL,
includeDefaultParameters = FALSE,
stringWrapParagraphWidth = 90,
prefix = "",
postfix = "",
stringWrapPrefix = "",
newArgumentValues = list(),
tolerance = 1e-07,
pipeOperator = c("auto", "none", "magrittr", "R"),
output = c("vector", "cat", "test", "markdown", "internal"),
explicitPrint = FALSE,
showVersus = FALSE
)Arguments
- obj
The result object, including a
TrialComparisonor its summary. Comparison reconstruction inlines each object's preconditions. Argument overrides are unsupported for comparisons, and their code is not word-wrapped so object names and callback bodies remain intact.- ...
Ensures that all arguments (starting from the "...") are to be named and that a warning will be displayed if unknown arguments are passed.
- leadingArguments
A character vector with arguments that shall be inserted at the beginning of the function command, e.g.,
design = x. Be careful with this option because the created R command may no longer be valid if used.- includeDefaultParameters
If
TRUE, default parameters will be included in allrpactcommands; default isFALSE.- stringWrapParagraphWidth
An integer value defining the number of characters after which a line break shall be inserted; set to
NULLto insert no line breaks.- prefix
A character string that shall be added to the beginning of the R command.
- postfix
A character string that shall be added to the end of the R command.
- stringWrapPrefix
A prefix character string that shall be added to each new line, typically some spaces.
- newArgumentValues
A named list with arguments that shall be renewed in the R command, e.g.,
newArgumentValues = list(informationRates = c(0.5, 1)).- tolerance
The tolerance for defining a value as default.
- pipeOperator
The pipe operator to use in the R code, default is "none".
- output
The output format, default is a character "vector".
- explicitPrint
Show an explicit
printcommand, default isFALSE.- showVersus
If
TRUE, reconstruct aTrialComparisonSummaryas a chain using%vs%. Default isFALSE. Asummary()call is appended only for non-default display settings or whenincludeDefaultParameters = TRUE. If omitted, use optionrpact.r.code.show.versusor environment variableRPACT_R_CODE_SHOW_VERSUS(the environment variable takes precedence). Explicit arguments override both settings. Other object classes are unaffected.includeDefaultParametersalso controls the contained objects.
Value
A character value or vector will be returned.
