-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #49 from rpact-com/dev/4.0.1
rhub workflow file added
Showing
12 changed files
with
172 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,4 @@ testthat-problems\.rds | |
^README\.html$ | ||
^codecov\.yml$ | ||
Rplots\.pdf | ||
^\.lintr$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# R-hub's generic GitHub Actions workflow file. It's canonical location is at | ||
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml | ||
# You can update this file to a newer version using the rhub2 package: | ||
# | ||
# rhub::rhub_setup() | ||
# | ||
# It is unlikely that you need to modify this file manually. | ||
|
||
name: R-hub | ||
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
config: | ||
description: 'A comma separated list of R-hub platforms to use.' | ||
type: string | ||
default: 'linux,windows,macos' | ||
name: | ||
description: 'Run name. You can leave this empty now.' | ||
type: string | ||
id: | ||
description: 'Unique ID. You can leave this empty now.' | ||
type: string | ||
|
||
jobs: | ||
|
||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
containers: ${{ steps.rhub-setup.outputs.containers }} | ||
platforms: ${{ steps.rhub-setup.outputs.platforms }} | ||
|
||
steps: | ||
# NO NEED TO CHECKOUT HERE | ||
- uses: r-hub/actions/setup@v1 | ||
with: | ||
config: ${{ github.event.inputs.config }} | ||
id: rhub-setup | ||
|
||
linux-containers: | ||
needs: setup | ||
if: ${{ needs.setup.outputs.containers != '[]' }} | ||
runs-on: ubuntu-latest | ||
name: ${{ matrix.config.label }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: ${{ fromJson(needs.setup.outputs.containers) }} | ||
container: | ||
image: ${{ matrix.config.container }} | ||
|
||
steps: | ||
- uses: r-hub/actions/checkout@v1 | ||
- uses: r-hub/actions/platform-info@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
- uses: r-hub/actions/setup-deps@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
- uses: r-hub/actions/run-check@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
|
||
other-platforms: | ||
needs: setup | ||
if: ${{ needs.setup.outputs.platforms != '[]' }} | ||
runs-on: ${{ matrix.config.os }} | ||
name: ${{ matrix.config.label }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: ${{ fromJson(needs.setup.outputs.platforms) }} | ||
|
||
steps: | ||
- uses: r-hub/actions/checkout@v1 | ||
- uses: r-hub/actions/setup-r@v1 | ||
with: | ||
job-config: ${{ matrix.config.job-config }} | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
- uses: r-hub/actions/platform-info@v1 | ||
with: | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
job-config: ${{ matrix.config.job-config }} | ||
- uses: r-hub/actions/setup-deps@v1 | ||
with: | ||
job-config: ${{ matrix.config.job-config }} | ||
token: ${{ secrets.RHUB_TOKEN }} | ||
- uses: r-hub/actions/run-check@v1 | ||
with: | ||
job-config: ${{ matrix.config.job-config }} | ||
token: ${{ secrets.RHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ | |
## | | ||
## | Contact us for information about our services: [email protected] | ||
## | | ||
## | File version: $Revision: 8087 $ | ||
## | Last changed: $Date: 2024-08-15 16:34:30 +0200 (Do, 15 Aug 2024) $ | ||
## | File version: $Revision: 8111 $ | ||
## | Last changed: $Date: 2024-08-20 14:20:14 +0200 (Di, 20 Aug 2024) $ | ||
## | Last changed by: $Author: pahlke $ | ||
## | | ||
|
||
|
@@ -1641,20 +1641,19 @@ SummaryFactory <- R6::R6Class("SummaryFactory", | |
return(header) | ||
} | ||
|
||
.addAlphaAndBetaToHeader <- function(header, design, designPlan, ..., endOfRecord = FALSE, powerEnabled = NA) { | ||
header <- .concatenateSummaryText(header, paste0( | ||
ifelse(design$sided == 1, "one-sided", "two-sided"), | ||
ifelse(design$kMax == 1, "", " overall") | ||
)) | ||
.addAlphaAndBetaToHeader <- function(header, design, designPlan, ..., endOfRecord = FALSE, powerEnabled = NA, sep = ", ") { | ||
if (is.na(powerEnabled)) { | ||
powerEnabled <- .isTrialDesignInverseNormalOrGroupSequential(design) && | ||
(is.null(designPlan) || (!.isSimulationResults(designPlan) && | ||
!identical("power", designPlan[[".objectType"]]))) | ||
} | ||
header <- .concatenateSummaryText(header, | ||
paste0("significance level ", round(100 * design$alpha, 2), "%", | ||
paste0( | ||
ifelse(design$sided == 1, "one-sided", "two-sided"), | ||
ifelse(design$kMax == 1, "", " overall"), | ||
" significance level ", round(100 * design$alpha, 2), "%", | ||
ifelse(!powerEnabled && endOfRecord, ".", "")), | ||
sep = " " | ||
sep = sep | ||
) | ||
if (powerEnabled) { | ||
header <- .concatenateSummaryText(header, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ | |
## | | ||
## | Contact us for information about our services: [email protected] | ||
## | | ||
## | File version: $Revision: 8087 $ | ||
## | Last changed: $Date: 2024-08-15 16:34:30 +0200 (Do, 15 Aug 2024) $ | ||
## | File version: $Revision: 8104 $ | ||
## | Last changed: $Date: 2024-08-19 10:30:01 +0200 (Mo, 19 Aug 2024) $ | ||
## | Last changed by: $Author: pahlke $ | ||
## | | ||
|
||
|
@@ -27,7 +27,7 @@ NULL | |
} | ||
|
||
.getDefaultDesign <- function(..., | ||
type = c("sampleSize", "power", "simulation", "analysis", "characteristics"), | ||
type = c("sampleSize", "power", "simulation", "simulationCounts", "analysis", "characteristics"), | ||
ignore = c()) { | ||
type <- match.arg(type) | ||
|
||
|
@@ -54,7 +54,7 @@ NULL | |
|
||
twoSidedPower <- .getOptionalArgument("twoSidedPower", ...) | ||
if (is.null(twoSidedPower)) { | ||
if (type %in% c("power", "simulation") && sided == 2) { | ||
if (type %in% c("power", "simulation", "simulationCounts") && sided == 2) { | ||
twoSidedPower <- TRUE | ||
} else { | ||
twoSidedPower <- C_TWO_SIDED_POWER_DEFAULT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,9 @@ | |
## | | ||
## | Contact us for information about our services: [email protected] | ||
## | | ||
## | File version: $Revision: 7742 $ | ||
## | Last changed: $Date: 2024-03-22 13:46:29 +0100 (Fr, 22 Mrz 2024) $ | ||
## | Last changed by: $Author: pahlke $ | ||
## | File version: $Revision: 8112 $ | ||
## | Last changed: $Date: 2024-08-20 15:44:53 +0200 (Di, 20 Aug 2024) $ | ||
## | Last changed by: $Author: wassmer $ | ||
## | | ||
|
||
#' @include f_core_constants.R | ||
|
@@ -38,9 +38,9 @@ NULL | |
#' Given a sequence of information rates (fixing the correlation structure), and | ||
#' decisionMatrix with either 2 or 4 rows and kMax = length(informationRates) columns, | ||
#' this function calculates a probability matrix containing, for two rows, the probabilities:\cr | ||
#' P(Z_1 <- l_1), P(l_1 <- Z_1 < u_1, Z_2 < l_1),..., P(l_kMax-1 <- Z_kMax-1 < u_kMax-1, Z_kMax < l_l_kMax)\cr | ||
#' P(Z_1 <- u_1), P(l_1 <- Z_1 < u_1, Z_2 < u_1),..., P(l_kMax-1 <- Z_kMax-1 < u_kMax-1, Z_kMax < u_l_kMax)\cr | ||
#' P(Z_1 <- Inf), P(l_1 <- Z_1 < u_1, Z_2 < Inf),..., P(l_kMax-1 <- Z_kMax-1 < u_kMax-1, Z_kMax < Inf)\cr | ||
#' P(Z_1 < l_1), P(l_1 < Z_1 < u_1, Z_2 < l_2),..., P(l_kMax-1 < Z_kMax-1 < u_kMax-1, Z_kMax < l_l_kMax)\cr | ||
#' P(Z_1 < u_1), P(l_1 < Z_1 < u_1, Z_2 < u_2),..., P(l_kMax-1 < Z_kMax-1 < u_kMax-1, Z_kMax < u_l_kMax)\cr | ||
#' P(Z_1 < Inf), P(l_1 < Z_1 < u_1, Z_2 < Inf),..., P(l_kMax-1 < Z_kMax-1 < u_kMax-1, Z_kMax < Inf)\cr | ||
#' with continuation matrix\cr | ||
#' l_1,...,l_kMax\cr | ||
#' u_1,...,u_kMax\cr | ||
|
@@ -423,6 +423,10 @@ getGroupSequentialProbabilities <- function(decisionMatrix, informationRates) { | |
.getDesignGroupSequentialKMax1 <- function(design) { | ||
design$criticalValues <- .getOneMinusQNorm(design$alpha / design$sided) | ||
design$alphaSpent[1] <- design$alpha | ||
design$.setParameterType("typeOfDesign", C_PARAM_NOT_APPLICABLE) | ||
if (!identical(design$typeOfDesign, C_DEFAULT_TYPE_OF_DESIGN)) { | ||
warning("'typeOfDesign' (", design$typeOfDesign, ") will be ignored because design is fixed", call. = FALSE) | ||
} | ||
return(invisible(design)) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,9 @@ | |
## | | ||
## | Contact us for information about our services: [email protected] | ||
## | | ||
## | File version: $Revision: 8052 $ | ||
## | Last changed: $Date: 2024-07-18 11:19:40 +0200 (Do, 18 Jul 2024) $ | ||
## | Last changed by: $Author: pahlke $ | ||
## | File version: $Revision: 8112 $ | ||
## | Last changed: $Date: 2024-08-20 15:44:53 +0200 (Di, 20 Aug 2024) $ | ||
## | Last changed by: $Author: wassmer $ | ||
## | | ||
|
||
.getInformationCountData <- function(lambda1, | ||
|
@@ -101,18 +101,14 @@ | |
#' @inheritParams param_accrualTime_counts | ||
#' @inheritParams param_accrualIntensity_counts | ||
#' @inheritParams param_followUpTime_counts | ||
#' @inheritParams param_maxNumberOfSubjects | ||
#' @inheritParams param_overdispersion_counts | ||
#' @inheritParams param_directionUpper | ||
#' @inheritParams param_allocationRatioPlanned | ||
#' @inheritParams param_plannedSubjects | ||
#' @inheritParams param_minNumberOfSubjectsPerStage | ||
#' @inheritParams param_maxNumberOfSubjectsPerStage | ||
#' @inheritParams param_conditionalPowerSimulation | ||
#' @inheritParams param_maxNumberOfSubjects_counts | ||
#' @inheritParams param_maxNumberOfIterations | ||
#' @inheritParams param_calcSubjectsFunction | ||
#' @inheritParams param_seed | ||
#' @inheritParams param_three_dots | ||
#' @inheritParams param_calcSubjectsFunction | ||
#' @inheritParams param_showStatistics | ||
#' | ||
#' @details | ||
|
@@ -156,8 +152,10 @@ | |
#' | ||
#' @template return_object_simulation_results | ||
#' @template how_to_get_help_for_generics | ||
#' | ||
#' @template examples_get_simulation_counts | ||
#' | ||
#' @keywords internal | ||
#' @export | ||
#' | ||
getSimulationCounts <- function(design = NULL, | ||
..., | ||
|
@@ -183,7 +181,7 @@ getSimulationCounts <- function(design = NULL, | |
directionUpper <- TRUE | ||
} | ||
if (is.null(design)) { | ||
design <- .getDefaultDesign(..., type = "simulation") | ||
design <- .getDefaultDesign(..., type = "simulationCounts") | ||
.warnInCaseOfUnknownArguments( | ||
functionName = "getSimulationCounts", | ||
ignore = .getDesignArgumentsToIgnoreAtUnknownArgumentCheck( | ||
|
@@ -192,7 +190,7 @@ getSimulationCounts <- function(design = NULL, | |
) | ||
) | ||
} else { | ||
.assertIsTrialDesign(design) | ||
.assertIsTrialDesignGroupSequential(design) | ||
.warnInCaseOfUnknownArguments( | ||
functionName = "getSimulationCounts", | ||
ignore = c("showStatistics"), ... | ||
|
@@ -426,7 +424,7 @@ getSimulationCounts <- function(design = NULL, | |
dfStartStop$output[, "recruitTime"] <= plannedCalendarTime[k] & | ||
dfStartStop$output[, "stopCalendar"] <= plannedCalendarTime[k], | ||
] | ||
if (length(kthStageWithEvents) > 0 && nrow(kthStageWithEvents) > 0) { | ||
if (length(kthStageWithEvents) > 0 && is.matrix(kthStageWithEvents) && nrow(kthStageWithEvents) > 0) { | ||
tab <- table(kthStageWithEvents[, "id"]) | ||
idx <- as.integer(names(tab)) | ||
counts[idx] <- as.vector(tab) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,9 @@ | |
## | | ||
## | Contact us for information about our services: [email protected] | ||
## | | ||
## | File version: $Revision: 7941 $ | ||
## | Last changed: $Date: 2024-05-28 08:44:36 +0200 (Di, 28 Mai 2024) $ | ||
## | Last changed by: $Author: pahlke $ | ||
## | File version: $Revision: 8112 $ | ||
## | Last changed: $Date: 2024-08-20 15:44:53 +0200 (Di, 20 Aug 2024) $ | ||
## | Last changed by: $Author: wassmer $ | ||
## | | ||
|
||
#' Parameter Description: "..." | ||
|
@@ -344,7 +344,11 @@ NULL | |
#' @keywords internal | ||
NULL | ||
|
||
|
||
#' Parameter Description: plannedMaxSubjects for Counts | ||
#' @param plannedMaxSubjects \code{plannedMaxSubjects > 0} needs to be specified. | ||
#' @name param_maxNumberOfSubjects_counts | ||
#' @keywords internal | ||
NULL | ||
|
||
## | ||
## Analysis | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.