From 4e465026b4af372d04cc981ee9c42c05c4f9733d Mon Sep 17 00:00:00 2001 From: Friedrich Pahlke Date: Fri, 23 Aug 2024 18:00:06 +0200 Subject: [PATCH] rpact hex sticker added --- DESCRIPTION | 4 +- NAMESPACE | 9 + R/class_analysis_dataset.R | 19 +- R/class_analysis_results.R | 2 +- R/class_analysis_stage_results.R | 11 +- R/class_core_parameter_set.R | 180 +++++++++++++++--- R/class_design.R | 18 +- R/class_design_plan.R | 8 +- R/class_design_power_and_asn.R | 8 +- R/class_design_set.R | 24 +-- R/class_dictionary.R | 12 +- R/class_event_probabilities.R | 4 +- R/class_summary.R | 10 +- R/class_time.R | 8 +- R/f_analysis_utilities.R | 6 +- R/f_as251.R | 6 +- R/f_core_assertions.R | 13 +- R/f_core_constants.R | 7 +- R/f_core_output_formats.R | 8 +- R/f_core_plot.R | 8 +- R/f_core_utilities.R | 27 ++- R/f_design_general_utilities.R | 6 +- R/f_design_group_sequential.R | 7 +- R/f_design_plan_plot.R | 2 +- R/f_simulation_base_count_data.R | 6 +- R/f_simulation_utilities.R | 13 +- README.Rmd | 7 +- README.md | 6 +- inst/doc/rpact_getting_started.Rmd | 2 +- inst/doc/rpact_getting_started.html | 6 +- man-roxygen/examples_get_dataset.R | 39 ++-- .../examples_get_design_characteristics.R | 2 + man-roxygen/examples_get_design_fisher.R | 2 + .../examples_get_design_group_sequential.R | 4 +- .../examples_get_design_inverse_normal.R | 2 +- .../examples_get_event_probabilities.R | 2 +- ...mples_get_group_sequential_probabilities.R | 6 +- man-roxygen/examples_get_number_of_subjects.R | 2 + man-roxygen/examples_get_output_format.R | 3 + .../examples_get_piecewise_survival_time.R | 3 +- ...ples_get_power_and_average_sample_number.R | 2 + man-roxygen/examples_get_power_counts.R | 3 +- man-roxygen/examples_get_power_means.R | 2 + man-roxygen/examples_get_power_rates.R | 3 +- man-roxygen/examples_get_power_survival.R | 3 +- man-roxygen/examples_get_sample_size_counts.R | 3 +- man-roxygen/examples_get_sample_size_means.R | 3 +- man-roxygen/examples_get_sample_size_rates.R | 3 +- .../examples_get_sample_size_survival.R | 3 +- man-roxygen/examples_get_simulation_counts.R | 25 +++ man-roxygen/examples_get_simulation_means.R | 3 +- man-roxygen/examples_get_simulation_rates.R | 3 +- .../examples_get_simulation_survival.R | 3 +- man-roxygen/examples_get_stage_results.R | 2 + man-roxygen/examples_get_test_actions.R | 2 + man-roxygen/examples_set_output_format.R | 3 +- ...frame.PowerAndAverageSampleNumberResult.Rd | 2 + man/as.data.frame.TrialDesign.Rd | 2 + ...s.data.frame.TrialDesignCharacteristics.Rd | 2 + man/as.data.frame.TrialDesignPlan.Rd | 2 + man/as.data.frame.TrialDesignSet.Rd | 2 + man/figures/logo.png | Bin 0 -> 50193 bytes man/getAvailablePlotTypes.Rd | 2 + man/getData.Rd | 2 + man/getDataset.Rd | 39 ++-- man/getDesignCharacteristics.Rd | 2 + man/getDesignFisher.Rd | 2 + man/getDesignGroupSequential.Rd | 4 +- man/getDesignInverseNormal.Rd | 2 +- man/getDesignSet.Rd | 6 +- man/getEventProbabilities.Rd | 2 +- man/getGroupSequentialProbabilities.Rd | 7 +- man/getNumberOfSubjects.Rd | 2 + man/getObservedInformationRates.Rd | 2 + man/getOutputFormat.Rd | 3 +- man/getParameterCaption.Rd | 2 + man/getParameterName.Rd | 2 + man/getPiecewiseSurvivalTime.Rd | 3 +- man/getPowerAndAverageSampleNumber.Rd | 2 + man/getPowerCounts.Rd | 3 +- man/getPowerMeans.Rd | 2 + man/getPowerRates.Rd | 3 +- man/getPowerSurvival.Rd | 3 +- man/getSampleSizeCounts.Rd | 3 +- man/getSampleSizeMeans.Rd | 3 +- man/getSampleSizeRates.Rd | 3 +- man/getSampleSizeSurvival.Rd | 3 +- man/getSimulationCounts.Rd | 3 +- man/getSimulationMeans.Rd | 3 +- man/getSimulationRates.Rd | 3 +- man/getSimulationSurvival.Rd | 3 +- man/getStageResults.Rd | 2 + man/getTestActions.Rd | 2 + man/kableParameterSet.Rd | 24 +++ man/knit_print.FieldSet.Rd | 27 +++ man/knit_print.ParameterSet.Rd | 1 + man/length.TrialDesignSet.Rd | 2 + man/mvstud.Rd | 2 + man/names.TrialDesignSet.Rd | 2 + man/param_maxNumberOfSubjects_counts.Rd | 12 ++ man/plot.Dataset.Rd | 4 +- man/plot.StageResults.Rd | 5 +- man/readDatasets.Rd | 2 + man/setOutputFormat.Rd | 3 +- ...tiesForPiecewiseExponentialDistribution.Rd | 2 + vignettes/rpact_getting_started.Rmd | 2 +- 106 files changed, 582 insertions(+), 217 deletions(-) create mode 100644 man-roxygen/examples_get_simulation_counts.R create mode 100644 man/figures/logo.png create mode 100644 man/knit_print.FieldSet.Rd create mode 100644 man/param_maxNumberOfSubjects_counts.Rd diff --git a/DESCRIPTION b/DESCRIPTION index d7560f9b..424c7371 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rpact Title: Confirmatory Adaptive Clinical Trial Design and Analysis -Version: 4.0.1.9248 -Date: 2024-08-21 +Version: 4.0.1.9250 +Date: 2024-08-23 Authors@R: c( person( given = "Gernot", diff --git a/NAMESPACE b/NAMESPACE index af7ab577..1aa96efb 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,7 +12,16 @@ S3method(as.list,Dictionary) S3method(as.matrix,FieldSet) S3method(as.vector,Dictionary) S3method(fetch,ParameterSet) +S3method(kable,FieldSet) S3method(kable,ParameterSet) +S3method(kable,array) +S3method(kable,character) +S3method(kable,data.frame) +S3method(kable,logical) +S3method(kable,matrix) +S3method(kable,numeric) +S3method(kable,table) +S3method(knit_print,FieldSet) S3method(knit_print,ParameterSet) S3method(knit_print,SummaryFactory) S3method(length,TrialDesignSet) diff --git a/R/class_analysis_dataset.R b/R/class_analysis_dataset.R index ec007b9b..3e51e683 100644 --- a/R/class_analysis_dataset.R +++ b/R/class_analysis_dataset.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8052 $ -## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -286,11 +286,13 @@ writeDataset <- function(dataset, file, ..., append = FALSE, quote = TRUE, sep = #' } #' #' @examples +#' \dontrun{ #' dataFile <- system.file("extdata", "datasets_rates.csv", package = "rpact") #' if (dataFile != "") { #' datasets <- readDatasets(dataFile) #' datasets #' } +#' } #' @export #' readDatasets <- function(file, ..., header = TRUE, sep = ",", quote = "\"", @@ -2250,7 +2252,7 @@ DatasetMeans <- R6::R6Class("DatasetMeans", ) #' @examples -#' +#' \dontrun{ #' datasetExample <- getDataset( #' means1 = c(112.3, 105.1, 121.3), #' means2 = c(98.1, 99.3, 100.1), @@ -2266,7 +2268,8 @@ DatasetMeans <- R6::R6Class("DatasetMeans", #' randomDataParamName = "outcome", numberOfVisits = 3, #' fixedCovariates = list(gender = c("f", "m"), bmi = c(17, 40)) #' ) -#' +#' } +#' #' @noRd #' .getRandomDataMeans <- function(dataset, ..., @@ -2504,6 +2507,7 @@ DatasetMeans <- R6::R6Class("DatasetMeans", #' @template return_object_ggplot #' #' @examples +#' \dontrun{ #' # Plot a dataset of means #' dataExample <- getDataset( #' n1 = c(22, 11, 22, 11), @@ -2513,9 +2517,7 @@ DatasetMeans <- R6::R6Class("DatasetMeans", #' stDevs1 = c(1, 2, 2, 1.3), #' stDevs2 = c(1, 2, 2, 1.3) #' ) -#' \dontrun{ #' if (require(ggplot2)) plot(dataExample, main = "Comparison of Means") -#' } #' #' # Plot a dataset of rates #' dataExample <- getDataset( @@ -2524,7 +2526,6 @@ DatasetMeans <- R6::R6Class("DatasetMeans", #' events1 = c(3, 5, 5, 6), #' events2 = c(8, 10, 12, 12) #' ) -#' \dontrun{ #' if (require(ggplot2)) plot(dataExample, main = "Comparison of Rates") #' } #' @@ -2534,7 +2535,7 @@ plot.Dataset <- function(x, y, ..., main = "Dataset", xlab = "Stage", ylab = NA_ legendTitle = "Group", palette = "Set1", showSource = FALSE, plotSettings = NULL) { markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( @@ -4255,7 +4256,7 @@ print.Dataset <- function(x, ..., markdown = NA, output = c("list", "long", "wid datasetName <- deparse(fCall$x) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("print") } output <- match.arg(output) diff --git a/R/class_analysis_results.R b/R/class_analysis_results.R index 5d94e719..b3146d8f 100644 --- a/R/class_analysis_results.R +++ b/R/class_analysis_results.R @@ -1833,7 +1833,7 @@ plot.AnalysisResults <- function(x, y, ..., type = 1L, showSource = FALSE, grid = 1, plotSettings = NULL) { markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( diff --git a/R/class_analysis_stage_results.R b/R/class_analysis_stage_results.R index dccf70ab..8e4079b6 100644 --- a/R/class_analysis_stage_results.R +++ b/R/class_analysis_stage_results.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8023 $ -## | Last changed: $Date: 2024-07-01 08:50:30 +0200 (Mo, 01 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -1520,21 +1520,18 @@ as.data.frame.StageResults <- function(x, row.names = NULL, #' @template return_object_ggplot #' #' @examples +#' \dontrun{ #' design <- getDesignGroupSequential( #' kMax = 4, alpha = 0.025, #' informationRates = c(0.2, 0.5, 0.8, 1), #' typeOfDesign = "WT", deltaWT = 0.25 #' ) -#' #' dataExample <- getDataset( #' n = c(20, 30, 30), #' means = c(50, 51, 55), #' stDevs = c(130, 140, 120) #' ) -#' #' stageResults <- getStageResults(design, dataExample, thetaH0 = 20) -#' -#' \dontrun{ #' if (require(ggplot2)) plot(stageResults, nPlanned = c(30), thetaRange = c(0, 100)) #' } #' @@ -1558,7 +1555,7 @@ plot.StageResults <- function( markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( diff --git a/R/class_core_parameter_set.R b/R/class_core_parameter_set.R index ffd97206..58df1582 100644 --- a/R/class_core_parameter_set.R +++ b/R/class_core_parameter_set.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8087 $ -## | Last changed: $Date: 2024-08-15 16:34:30 +0200 (Do, 15 Aug 2024) $ +## | File version: $Revision: 8124 $ +## | Last changed: $Date: 2024-08-23 08:41:16 +0200 (Fr, 23 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -719,10 +719,6 @@ ParameterSet <- R6::R6Class("ParameterSet", .printAsDataFrame = function(parameterNames, niceColumnNamesEnabled = FALSE, includeAllParameters = FALSE, handleParameterNamesAsToBeExcluded = FALSE, lineBreakEnabled = FALSE) { - if (.isTrialDesignPlan(self)) { - parameterNames <- NULL - } - dataFrame <- .getAsDataFrame( parameterSet = self, parameterNames = parameterNames, @@ -732,12 +728,6 @@ ParameterSet <- R6::R6Class("ParameterSet", returnParametersAsCharacter = TRUE ) result <- as.matrix(dataFrame) - if (.isTrialDesignPlan(self)) { - dimnames(result)[[1]] <- paste(" ", c(1:nrow(dataFrame))) - } else if (!is.null(dataFrame[["stages"]])) { - dimnames(result)[[1]] <- paste(" Stage", dataFrame$stages) - } - print(result, quote = FALSE, right = FALSE) }, .getNumberOfRows = function(parameterNames) { @@ -894,13 +884,6 @@ ParameterSet <- R6::R6Class("ParameterSet", } return(x[which(names(x) %in% listEntryNames)]) - }, - .isMultiHypothesesObject = function() { - return(.isEnrichmentAnalysisResults(self) || .isEnrichmentStageResults(self) || - .isMultiArmAnalysisResults(self) || .isMultiArmStageResults(self)) - }, - .isEnrichmentObject = function() { - return(.isEnrichmentAnalysisResults(self) || .isEnrichmentStageResults(self)) } ) ) @@ -929,7 +912,7 @@ ParameterSet <- R6::R6Class("ParameterSet", parameterValues <- parameterSet[[parameterName]] if (!is.null(parameterValues) && (is.matrix(parameterValues) || !is.array(parameterValues))) { if (is.matrix(parameterValues)) { - if (parameterSet$.isMultiHypothesesObject()) { + if (.isMultiHypothesesObject(parameterSet)) { if (nrow(parameterValues) > n && ncol(parameterValues) > 0) { n <- nrow(parameterValues) } @@ -937,7 +920,7 @@ ParameterSet <- R6::R6Class("ParameterSet", n <- ncol(parameterValues) } } else if (length(parameterValues) > n && - !parameterSet$.isMultiHypothesesObject()) { + !.isMultiHypothesesObject(parameterSet)) { n <- length(parameterValues) } } @@ -984,7 +967,7 @@ ParameterSet <- R6::R6Class("ParameterSet", return(rep(parameterValues, numberOfVariants * numberOfStages)) } - if (parameterSet$.isMultiHypothesesObject()) { + if (.isMultiHypothesesObject(parameterSet)) { if (length(parameterValues) == numberOfStages) { return(as.vector(sapply(FUN = rep, X = parameterValues, times = numberOfVariants))) } @@ -1056,7 +1039,7 @@ ParameterSet <- R6::R6Class("ParameterSet", } # applicable for analysis enrichment - if (parameterSet$.isMultiHypothesesObject()) { + if (.isMultiHypothesesObject(parameterSet)) { if (nrow(parameterValues) %in% c(1, numberOfVariants) && ncol(parameterValues) %in% c(1, numberOfStages)) { columnValues <- c() @@ -1111,7 +1094,7 @@ ParameterSet <- R6::R6Class("ParameterSet", ) names(dataFrame) <- stagesCaption - if (parameterSet$.isEnrichmentObject()) { + if (.isEnrichmentObject(parameterSet)) { populations <- character() for (i in 1:numberOfVariants) { populations <- c(populations, ifelse(i == numberOfVariants, "F", paste0("S", i))) @@ -1420,7 +1403,7 @@ print.FieldSet <- function(x, ..., markdown = NA) { sysCalls <- sys.calls() if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("print") } if (isTRUE(markdown)) { @@ -1623,12 +1606,17 @@ summary.ParameterSet <- function(object, ..., } object$.cat(object$.toString(startWithUpperCase = TRUE), " table:\n", heading = 1) - parametersToShow <- object$.getParametersToShow() - for (parameter in parametersToShow) { - if (length(object[[parameter]]) == 1) { - parametersToShow <- parametersToShow[parametersToShow != parameter] + if (.isTrialDesignPlan(object)) { + parametersToShow <- NULL + } else { + parametersToShow <- object$.getParametersToShow() + for (parameter in parametersToShow) { + if (length(object[[parameter]]) == 1) { + parametersToShow <- parametersToShow[parametersToShow != parameter] + } } } + object$.printAsDataFrame(parameterNames = parametersToShow, niceColumnNamesEnabled = TRUE) invisible(object) } @@ -1673,7 +1661,7 @@ print.ParameterSet <- function(x, ..., markdown = NA) { sysCalls <- sys.calls() if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("print") } if (isTRUE(markdown)) { @@ -1887,6 +1875,35 @@ plot.ParameterSet <- function(x, y, ..., main = NA_character_, ) } +#' +#' @title +#' Print Field Set in Markdown Code Chunks +#' +#' @description +#' The function `knit_print.FieldSet` is the default printing function for rpact result objects in knitr. +#' The chunk option `render` uses this function by default. +#' To fall back to the normal printing behavior set the chunk option `render = normal_print`. +#' For more information see \code{\link[knitr]{knit_print}}. +#' +#' @param x A \code{FieldSet}. +#' @param ... Other arguments (see \code{\link[knitr]{knit_print}}). +#' +#' @details +#' Generic function to print a field set in Markdown. +#' Use \code{options("rpact.print.heading.base.number" = "NUMBER")} (where \code{NUMBER} is an integer value >= -1) to +#' specify the heading level. The default is \code{options("rpact.print.heading.base.number" = "0")}, i.e., the +#' top headings start with \code{##} in Markdown. \code{options("rpact.print.heading.base.number" = "-1")} means +#' that all headings will be written bold but are not explicit defined as header. +#' +#' @keywords internal +#' +#' @export +#' +knit_print.FieldSet <- function(x, ...) { + result <- paste0(utils::capture.output(x$.catMarkdownText()), collapse = "\n") + return(knitr::asis_output(result)) +} + #' #' @title #' Print Parameter Set in Markdown Code Chunks @@ -1907,6 +1924,8 @@ plot.ParameterSet <- function(x, y, ..., main = NA_character_, #' top headings start with \code{##} in Markdown. \code{options("rpact.print.heading.base.number" = "-1")} means #' that all headings will be written bold but are not explicit defined as header. #' +#' @keywords internal +#' #' @export #' knit_print.ParameterSet <- function(x, ...) { @@ -1982,6 +2001,107 @@ kable.ParameterSet <- function(x, ...) { #' #' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.FieldSet <- function(x, ..., + enforceRowNames = TRUE, niceColumnNamesEnabled = TRUE) { + .assertPackageIsInstalled("knitr") + knitr::kable(as.matrix(x, + enforceRowNames = enforceRowNames, + niceColumnNamesEnabled = niceColumnNamesEnabled), ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.data.frame <- function(x, ...) { + .assertPackageIsInstalled("knitr") + knitr::kable(x, ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.table <- function(x, ...) { + .assertPackageIsInstalled("knitr") + knitr::kable(x, ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.matrix <- function(x, ...) { + .assertPackageIsInstalled("knitr") + knitr::kable(x, ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.array <- function(x, ...) { + .assertPackageIsInstalled("knitr") + knitr::kable(x, ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.numeric <- function(x, ...) { + .assertPackageIsInstalled("knitr") + knitr::kable(x, ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.character <- function(x, ...) { + .assertPackageIsInstalled("knitr") + knitr::kable(x, ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal +#' +#' @export +#' +kable.logical <- function(x, ...) { + .assertPackageIsInstalled("knitr") + knitr::kable(x, ...) +} + +#' +#' @rdname kableParameterSet +#' +#' @keywords internal #' #' @export #' diff --git a/R/class_design.R b/R/class_design.R index 0211a0a3..f1401273 100644 --- a/R/class_design.R +++ b/R/class_design.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8023 $ -## | Last changed: $Date: 2024-07-01 08:50:30 +0200 (Mo, 01 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -297,7 +297,7 @@ print.TrialDesignCharacteristics <- function(x, ..., markdown = NA, showDesign = sysCalls <- sys.calls() if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("print") } if (isTRUE(markdown)) { @@ -344,8 +344,10 @@ print.TrialDesignCharacteristics <- function(x, ..., markdown = NA, showDesign = #' @template return_dataframe #' #' @examples +#' \dontrun{ #' as.data.frame(getDesignCharacteristics(getDesignGroupSequential())) -#' +#' } +#' #' @export #' #' @keywords internal @@ -1120,7 +1122,7 @@ plot.TrialDesign <- function( markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( @@ -1211,7 +1213,7 @@ plot.TrialDesign <- function( plot.TrialDesignCharacteristics <- function(x, y, ...) { markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } if (markdown) { @@ -1300,8 +1302,10 @@ plot.TrialDesignCharacteristics <- function(x, y, ...) { #' @template return_dataframe #' #' @examples +#' \dontrun{ #' as.data.frame(getDesignGroupSequential()) -#' +#' } +#' #' @export #' #' @keywords internal diff --git a/R/class_design_plan.R b/R/class_design_plan.R index 191f9ccd..dd9e0f7d 100644 --- a/R/class_design_plan.R +++ b/R/class_design_plan.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8023 $ -## | Last changed: $Date: 2024-07-01 08:50:30 +0200 (Mo, 01 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -285,8 +285,10 @@ TrialDesignPlan <- R6::R6Class("TrialDesignPlan", #' @template return_dataframe #' #' @examples +#' \dontrun{ #' as.data.frame(getSampleSizeMeans()) -#' +#' } +#' #' @export #' #' @keywords internal diff --git a/R/class_design_power_and_asn.R b/R/class_design_power_and_asn.R index 4bd22659..0b6dc83d 100644 --- a/R/class_design_power_and_asn.R +++ b/R/class_design_power_and_asn.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 7958 $ -## | Last changed: $Date: 2024-05-30 09:56:27 +0200 (Do, 30 Mai 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -310,10 +310,12 @@ PowerAndAverageSampleNumberResult <- R6::R6Class("PowerAndAverageSampleNumberRes #' @template return_dataframe #' #' @examples +#' \dontrun{ #' data <- as.data.frame(getPowerAndAverageSampleNumber(getDesignGroupSequential())) #' head(data) #' dim(data) -#' +#' } +#' #' @export #' #' @keywords internal diff --git a/R/class_design_set.R b/R/class_design_set.R index a5a64232..cecdbc0b 100644 --- a/R/class_design_set.R +++ b/R/class_design_set.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8052 $ -## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -54,6 +54,7 @@ NULL #' @template how_to_get_help_for_generics #' #' @examples +#' \dontrun{ #' # Example 1 #' design <- getDesignGroupSequential( #' alpha = 0.05, kMax = 6, @@ -61,9 +62,7 @@ NULL #' ) #' designSet <- getDesignSet() #' designSet$add(design = design, deltaWT = c(0.3, 0.4)) -#' \dontrun{ #' if (require(ggplot2)) plot(designSet, type = 1) -#' } #' #' # Example 2 (shorter script) #' design <- getDesignGroupSequential( @@ -71,9 +70,7 @@ NULL #' sided = 2, typeOfDesign = "WT", deltaWT = 0.1 #' ) #' designSet <- getDesignSet(design = design, deltaWT = c(0.3, 0.4)) -#' \dontrun{ #' if (require(ggplot2)) plot(designSet, type = 1) -#' } #' #' # Example 3 (use of designs instead of design) #' d1 <- getDesignGroupSequential( @@ -90,7 +87,6 @@ NULL #' designs = c(d1, d2), #' variedParameters = c("typeOfDesign", "kMax") #' ) -#' \dontrun{ #' if (require(ggplot2)) plot(designSet, type = 8, nMax = 20) #' } #' @@ -580,9 +576,11 @@ TrialDesignSet <- R6::R6Class("TrialDesignSet", #' @template return_names #' #' @examples +#' \dontrun{ #' designSet <- getDesignSet(design = getDesignGroupSequential(), alpha = c(0.01, 0.05)) #' names(designSet) -#' +#' } +#' #' @export #' #' @keywords internal @@ -607,9 +605,11 @@ names.TrialDesignSet <- function(x) { #' representing the number of design in the \code{TrialDesignSet}. #' #' @examples +#' \dontrun{ #' designSet <- getDesignSet(design = getDesignGroupSequential(), alpha = c(0.01, 0.05)) #' length(designSet) -#' +#' } +#' #' @export #' #' @keywords internal @@ -704,9 +704,11 @@ length.TrialDesignSet <- function(x) { #' @template return_dataframe #' #' @examples +#' \dontrun{ #' designSet <- getDesignSet(design = getDesignGroupSequential(), alpha = c(0.01, 0.05)) #' as.data.frame(designSet) -#' +#' } +#' #' @export #' #' @keywords internal @@ -881,7 +883,7 @@ plot.TrialDesignSet <- function( markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( diff --git a/R/class_dictionary.R b/R/class_dictionary.R index 3503f14d..aa98f5a4 100644 --- a/R/class_dictionary.R +++ b/R/class_dictionary.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 7742 $ -## | Last changed: $Date: 2024-03-22 13:46:29 +0100 (Fr, 22 Mrz 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -45,9 +45,11 @@ createDictionary <- function(name, keyValuePairList = NULL) { #' #' @examples +#' \dontrun{ #' x <- createDictionary("x", list(a = 1, b = 2, c = 3)) #' getDictionaryKeyByValue(x, 2) -#' +#' } +#' #' @noRd #' getDictionaryKeyByValue <- function(x, value) { @@ -59,9 +61,11 @@ getDictionaryKeyByValue <- function(x, value) { #' #' @examples +#' \dontrun{ #' x <- createDictionary("x", list(a = 1, b = 2, c = 3)) #' getDictionarySubset(x, c("b", "c")) -#' +#' } +#' #' @noRd #' getDictionarySubset <- function(x, subsetNames) { diff --git a/R/class_event_probabilities.R b/R/class_event_probabilities.R index 21ad10f8..8f3164e0 100644 --- a/R/class_event_probabilities.R +++ b/R/class_event_probabilities.R @@ -291,7 +291,7 @@ plot.EventProbabilities <- function( markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( @@ -528,7 +528,7 @@ plot.NumberOfSubjects <- function( markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( diff --git a/R/class_summary.R b/R/class_summary.R index 0759a7a5..e50c8252 100644 --- a/R/class_summary.R +++ b/R/class_summary.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8111 $ -## | Last changed: $Date: 2024-08-20 14:20:14 +0200 (Di, 20 Aug 2024) $ +## | File version: $Revision: 8124 $ +## | Last changed: $Date: 2024-08-23 08:41:16 +0200 (Fr, 23 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -88,7 +88,7 @@ plot.SummaryFactory <- function(x, y, ..., showSummary = FALSE) { if (isTRUE(showSummary) || .isSummaryPipe(fCall)) { markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } if (markdown) { sep <- "\n\n-----\n\n" @@ -138,7 +138,7 @@ plot.SummaryFactory <- function(x, y, ..., showSummary = FALSE) { result <- .addKnitPrintPart(x, result, sep = sep, prefix = prefix) } if (length(result) == 0 || all(nchar(trimws(result)) == 0)) { - return("") + return(invisible()) } return(knitr::asis_output(result)) @@ -202,7 +202,7 @@ print.SummaryFactory <- function(x, ..., sep = "\n\n-----\n\n") { if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("summary") } if (markdown || isTRUE(x[["markdown"]])) { diff --git a/R/class_time.R b/R/class_time.R index cfc48a3b..20a33e80 100644 --- a/R/class_time.R +++ b/R/class_time.R @@ -664,14 +664,16 @@ PiecewiseSurvivalTime <- R6::R6Class("PiecewiseSurvivalTime", data <- data.frame( piecewiseSurvivalTime = self$piecewiseSurvivalTime, lambda1 = self$lambda1, - lambda2 = self$lambda2 + lambda2 = self$lambda2, + hazardRatio = self$hazardRatio ) - rownames(data) <- as.character(1:nrow(data)) colnames(data) <- c( "Start time", .getParameterCaption("lambda1", tableOutputEnabled = TRUE), - .getParameterCaption("lambda2", tableOutputEnabled = TRUE) + .getParameterCaption("lambda2", tableOutputEnabled = TRUE), + .getParameterCaption("hazardRatio", tableOutputEnabled = TRUE) ) + rownames(data) <- as.character(1:nrow(data)) return(data) }, .isPiBased = function() { diff --git a/R/f_analysis_utilities.R b/R/f_analysis_utilities.R index c4065667..4b5cd34a 100644 --- a/R/f_analysis_utilities.R +++ b/R/f_analysis_utilities.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8052 $ -## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -1027,6 +1027,7 @@ getLongFormat <- function(dataInput) { #' } #' #' @examples +#' \dontrun{ #' # Absolute information epsilon: #' # decision rule 45 >= 46 - 1, i.e., under-running #' data <- getDataset( @@ -1047,6 +1048,7 @@ getLongFormat <- function(dataInput) { #' getObservedInformationRates(data, #' maxInformation = 46, informationEpsilon = 0.03 #' ) +#' } #' #' @return Returns a list that summarizes the observed information rates. #' diff --git a/R/f_as251.R b/R/f_as251.R index 6785fb81..eb7d014c 100644 --- a/R/f_as251.R +++ b/R/f_as251.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 7947 $ -## | Last changed: $Date: 2024-05-28 14:25:47 +0200 (Di, 28 Mai 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -168,6 +168,7 @@ as251Normal <- function(lower, upper, sigma, ..., #' @param HINC Interval width for Simpson's rule. Value of zero caused a default .24 to be used #' #' @examples +#' \dontrun{ #' N <- 3 #' RHO <- 0.5 #' B <- rep(-5.0, length = N) @@ -177,6 +178,7 @@ as251Normal <- function(lower, upper, sigma, ..., #' D <- rep(0.0, length = N) #' result <- mvstud(NDF = 0, A = A, B = B, BPD = BPD, INF = INF, D = D) #' result +#' } #' #' @export #' diff --git a/R/f_core_assertions.R b/R/f_core_assertions.R index 98a76d7f..e78ff348 100644 --- a/R/f_core_assertions.R +++ b/R/f_core_assertions.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8052 $ -## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ +## | File version: $Revision: 8124 $ +## | Last changed: $Date: 2024-08-23 08:41:16 +0200 (Fr, 23 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -2242,6 +2242,15 @@ NULL grepl("Enrichment", .getClassName(conditionalPowerResults))) } +.isMultiHypothesesObject = function(x) { + return(.isEnrichmentAnalysisResults(x) || .isEnrichmentStageResults(x) || + .isMultiArmAnalysisResults(x) || .isMultiArmStageResults(x)) +} + +.isEnrichmentObject = function(x) { + return(.isEnrichmentAnalysisResults(x) || .isEnrichmentStageResults(x)) +} + .isMultiArmAnalysisResults <- function(analysisResults) { return(inherits(analysisResults, "AnalysisResultsMultiArm")) } diff --git a/R/f_core_constants.R b/R/f_core_constants.R index 43acbd2b..529e202f 100644 --- a/R/f_core_constants.R +++ b/R/f_core_constants.R @@ -13,9 +13,9 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8059 $ -## | Last changed: $Date: 2024-07-23 09:51:27 +0200 (Di, 23 Jul 2024) $ -## | Last changed by: $Author: wassmer $ +## | File version: $Revision: 8124 $ +## | Last changed: $Date: 2024-08-23 08:41:16 +0200 (Fr, 23 Aug 2024) $ +## | Last changed by: $Author: pahlke $ ## | #' @include class_dictionary.R @@ -1236,6 +1236,7 @@ C_PARAMETER_FORMAT_FUNCTIONS <- createDictionary("C_PARAMETER_FORMAT_FUNCTIONS", inflationFactor = ".formatProbabilities", information = ".formatRates", power = ".formatProbabilities", + sided = ".formatSided", rejectionProbabilities = ".formatProbabilities", futilityProbabilities = ".formatFutilityProbabilities", probs = ".formatProbabilities", diff --git a/R/f_core_output_formats.R b/R/f_core_output_formats.R index de457234..3f6590e6 100644 --- a/R/f_core_output_formats.R +++ b/R/f_core_output_formats.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8052 $ -## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ +## | File version: $Revision: 8124 $ +## | Last changed: $Date: 2024-08-23 08:41:16 +0200 (Fr, 23 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -723,6 +723,10 @@ C_OUTPUT_FORMAT_DEFAULT_VALUES <- pairlist( return(.getFormattedValue(.getZeroCorrectedValue(value), digits = 3)) } +.formatSided <- function(value) { + return(ifelse(value == 1, "one-sided", "two-sided")) +} + .formatHowItIs <- function(value) { return(format(value, scientific = FALSE)) } diff --git a/R/f_core_plot.R b/R/f_core_plot.R index 6671d33f..4cd70774 100644 --- a/R/f_core_plot.R +++ b/R/f_core_plot.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8052 $ -## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -377,12 +377,14 @@ plotTypes <- function(obj, output = c("numeric", "caption", "numcap", "capnum"), #' of numeric type for \code{option=numeric}. #' #' @examples +#' \dontrun{ #' design <- getDesignInverseNormal(kMax = 2) #' getAvailablePlotTypes(design, "numeric") #' plotTypes(design, "caption") #' getAvailablePlotTypes(design, "numcap") #' plotTypes(design, "capnum") -#' +#' } +#' #' @export #' getAvailablePlotTypes <- function(obj, output = c("numeric", "caption", "numcap", "capnum"), diff --git a/R/f_core_utilities.R b/R/f_core_utilities.R index 1ebe4add..628a870e 100644 --- a/R/f_core_utilities.R +++ b/R/f_core_utilities.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8052 $ -## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -133,11 +133,13 @@ NULL #' @return the value of the optional argument if it exists; NULL otherwise. #' #' @examples +#' \dontrun{ #' f <- function(...) { #' print(.getOptionalArgument("x", ...)) #' } #' f(x = 1) #' f(y = 1) +#' } #' #' @keywords internal #' @@ -256,6 +258,7 @@ NULL #' #' @examples +#' \dontrun{ #' .getConcatenatedValues(1) #' .getConcatenatedValues(1:2) #' .getConcatenatedValues(1:3) @@ -271,7 +274,8 @@ NULL #' .getConcatenatedValues(1, mode = "or", separator = ";") #' .getConcatenatedValues(1:2, mode = "or", separator = ";") #' .getConcatenatedValues(1:3, mode = "or", separator = ";") -#' +#' } +#' #' @noRd #' .arrayToString <- function(x, ..., separator = ", ", @@ -1043,8 +1047,10 @@ printCitation <- function(inclusiveR = TRUE, language = "en") { #' Returns \code{NULL} if the specified \code{parameterName} does not exist. #' #' @examples +#' \dontrun{ #' getParameterCaption(getDesignInverseNormal(), "kMax") -#' +#' } +#' #' @keywords internal #' #' @export @@ -1076,8 +1082,10 @@ getParameterCaption <- function(obj, parameterName) { #' Returns \code{NULL} if the specified \code{parameterCaption} does not exist. #' #' @examples +#' \dontrun{ #' getParameterName(getDesignInverseNormal(), "Maximum number of stages") -#' +#' } +#' #' @keywords internal #' #' @export @@ -1172,6 +1180,7 @@ getParameterName <- function(obj, parameterCaption) { } #' @examples +#' \dontrun{ #' or1 <- list( #' and1 = FALSE, #' and2 = TRUE, @@ -1194,6 +1203,7 @@ getParameterName <- function(obj, parameterCaption) { #' ) #' ) #' ) +#' } #' #' @noRd #' @@ -1391,7 +1401,12 @@ getParameterName <- function(obj, parameterCaption) { ) } -.isMarkdownEnabled <- function() { +.isMarkdownEnabled <- function(type = c("all", "print", "summary", "plot")) { + type = match.arg(type) + if (!as.logical(getOption(paste0("rpact.auto.markdown.", type), TRUE))) { + return(FALSE) + } + return(!is.null(knitr::current_input())) } diff --git a/R/f_design_general_utilities.R b/R/f_design_general_utilities.R index 2852d154..ccb6f7a0 100644 --- a/R/f_design_general_utilities.R +++ b/R/f_design_general_utilities.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8104 $ -## | Last changed: $Date: 2024-08-19 10:30:01 +0200 (Mo, 19 Aug 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -695,6 +695,7 @@ NULL #' @return A \code{\link[base]{numeric}} value or vector will be returned. #' #' @examples +#' \dontrun{ #' # Calculate probabilties for a range of time values for a #' # piecewise exponential distribution with hazard rates #' # 0.025, 0.04, 0.015, and 0.007 in the intervals @@ -712,6 +713,7 @@ NULL #' getPiecewiseExponentialQuantile(y, #' piecewiseSurvivalTime = piecewiseSurvivalTime #' ) +#' } #' #' @name utilitiesForPiecewiseExponentialDistribution #' diff --git a/R/f_design_group_sequential.R b/R/f_design_group_sequential.R index 0e59247c..17577e98 100644 --- a/R/f_design_group_sequential.R +++ b/R/f_design_group_sequential.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8112 $ -## | Last changed: $Date: 2024-08-20 15:44:53 +0200 (Di, 20 Aug 2024) $ +## | File version: $Revision: 8123 $ +## | Last changed: $Date: 2024-08-23 08:37:23 +0200 (Fr, 23 Aug 2024) $ ## | Last changed by: $Author: wassmer $ ## | @@ -44,6 +44,9 @@ NULL #' with continuation matrix\cr #' l_1,...,l_kMax\cr #' u_1,...,u_kMax\cr +#' That is, the output matrix of the function provides per stage (column) the cumulative probabilities +#' for values specified in decisionMatrix and Inf, and reaching the stage, i.e., the test +#' statistics is in the continuation region for the preceding stages. #' For 4 rows, the continuation region contains of two regions and the probability matrix is #' obtained analogously (cf., Wassmer and Brannath, 2016). #' diff --git a/R/f_design_plan_plot.R b/R/f_design_plan_plot.R index 8665d7e2..36514711 100644 --- a/R/f_design_plan_plot.R +++ b/R/f_design_plan_plot.R @@ -1390,7 +1390,7 @@ plot.TrialDesignPlan <- function( markdown <- .getOptionalArgument("markdown", ..., optionalArgumentDefaultValue = NA) if (is.na(markdown)) { - markdown <- .isMarkdownEnabled() + markdown <- .isMarkdownEnabled("plot") } args <- list( diff --git a/R/f_simulation_base_count_data.R b/R/f_simulation_base_count_data.R index b0e9b33b..90201c48 100644 --- a/R/f_simulation_base_count_data.R +++ b/R/f_simulation_base_count_data.R @@ -13,9 +13,9 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 8112 $ -## | Last changed: $Date: 2024-08-20 15:44:53 +0200 (Di, 20 Aug 2024) $ -## | Last changed by: $Author: wassmer $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ +## | Last changed by: $Author: pahlke $ ## | .getInformationCountData <- function(lambda1, diff --git a/R/f_simulation_utilities.R b/R/f_simulation_utilities.R index 308a894f..9d6eef7d 100644 --- a/R/f_simulation_utilities.R +++ b/R/f_simulation_utilities.R @@ -13,8 +13,8 @@ ## | ## | Contact us for information about our services: info@rpact.com ## | -## | File version: $Revision: 7742 $ -## | Last changed: $Date: 2024-03-22 13:46:29 +0100 (Fr, 22 Mrz 2024) $ +## | File version: $Revision: 8113 $ +## | Last changed: $Date: 2024-08-21 10:25:39 +0200 (Mi, 21 Aug 2024) $ ## | Last changed by: $Author: pahlke $ ## | @@ -36,10 +36,11 @@ NULL #' @return the (generated) seed. #' #' @examples -#' +#' \dontrun{ #' .setSeed(12345) -#' #' mySeed <- .setSeed() +#' mySeed +#' } #' #' @keywords internal #' @@ -692,6 +693,7 @@ C_EFFECT_LIST_NAMES_EXPECTED_SURVIVAL <- c("subGroups", "prevalences", "piContro #' @template return_dataframe #' #' @examples +#' \dontrun{ #' results <- getSimulationSurvival( #' pi1 = seq(0.3, 0.6, 0.1), pi2 = 0.3, eventTime = 12, #' accrualTime = 24, plannedEvents = 40, maxNumberOfSubjects = 200, @@ -700,7 +702,8 @@ C_EFFECT_LIST_NAMES_EXPECTED_SURVIVAL <- c("subGroups", "prevalences", "piContro #' data <- getData(results) #' head(data) #' dim(data) -#' +#' } +#' #' @export #' getData <- function(x) { diff --git a/README.Rmd b/README.Rmd index 9d048bb9..a2f82f26 100644 --- a/README.Rmd +++ b/README.Rmd @@ -8,7 +8,8 @@ output: knitr::opts_chunk$set( collapse = TRUE, comment = "#>", - fig.path = "README-" + fig.path = "man/figures/README-", + out.width = "100%" ) ``` @@ -25,7 +26,7 @@ knitr::opts_chunk$set( [![](https://img.shields.io/badge/RPACT-Cloud-blue.svg)](https://rpact.shinyapps.io/cloud) -# rpact +# rpact Confirmatory Adaptive Clinical Trial Design, Simulation, and Analysis. @@ -37,7 +38,7 @@ Confirmatory Adaptive Clinical Trial Design, Simulation, and Analysis. + rates (binary endpoint) + survival trials with flexible recruitment and survival time options + count data -* Simulation tool for means, rates, and survival data +* Simulation tool for means, rates, survival data, and count data + Assessment of adaptive sample size/event number recalculations based on conditional power + Assessment of treatment selection strategies in multi-arm trials diff --git a/README.md b/README.md index c9f7dafd..2ebae00c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + [![](https://www.r-pkg.org/badges/version/rpact)](https://cran.r-project.org/package=rpact) [![R-CMD-check](https://github.com/rpact-com/rpact/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rpact-com/rpact/actions/workflows/R-CMD-check.yaml) @@ -11,7 +13,7 @@ [![](https://img.shields.io/badge/RPACT-Cloud-blue.svg)](https://rpact.shinyapps.io/cloud) -# rpact +# rpact Confirmatory Adaptive Clinical Trial Design, Simulation, and Analysis. @@ -24,7 +26,7 @@ Confirmatory Adaptive Clinical Trial Design, Simulation, and Analysis. - survival trials with flexible recruitment and survival time options - count data -- Simulation tool for means, rates, and survival data +- Simulation tool for means, rates, survival data, and count data - Assessment of adaptive sample size/event number recalculations based on conditional power - Assessment of treatment selection strategies in multi-arm trials diff --git a/inst/doc/rpact_getting_started.Rmd b/inst/doc/rpact_getting_started.Rmd index 6f9ae950..edd18b7c 100644 --- a/inst/doc/rpact_getting_started.Rmd +++ b/inst/doc/rpact_getting_started.Rmd @@ -26,7 +26,7 @@ knitr::opts_chunk$set( + rates (binary endpoint) + survival trials with flexible recruitment and survival time options + count data -* Simulation tool for means, rates, and survival data +* Simulation tool for means, rates, survival data, and count data + Assessment of adaptive sample size/event number recalculations based on conditional power + Assessment of treatment selection strategies in multi-arm trials diff --git a/inst/doc/rpact_getting_started.html b/inst/doc/rpact_getting_started.html index 90108016..a513cb87 100644 --- a/inst/doc/rpact_getting_started.html +++ b/inst/doc/rpact_getting_started.html @@ -12,7 +12,7 @@ - + Getting started with rpact @@ -239,7 +239,7 @@

Getting started with rpact

Friedrich Pahlke and Gernot Wassmer

-

2024-08-19

+

2024-08-23

@@ -257,7 +257,7 @@

Functional Range

options
  • count data
  • -
  • Simulation tool for means, rates, and survival data +
  • Simulation tool for means, rates, survival data, and count data