Skip to content

Commit

Permalink
- addressing some Notes & Warning from devtools::check()
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Wojciekowski authored and Stephan Wojciekowski committed Dec 12, 2023
1 parent d62f037 commit 1ea587f
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 22 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Imports:
DoseFinding,
DoseFinding (>= 1.1-1),
ggplot2,
stats,
RBesT,
Expand Down
20 changes: 13 additions & 7 deletions R/BMCPMod.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
#' @param n_patients Vector specifying the planned number of patients per dose group
#' @param mods An object of class "Mods" as specified in the Dosefinding package.
#' @param prior_list a prior_list object specifying the utilized prior for the different dose groups
#' @param sd tbd
#' @param n_sim number of simulations to be performed
#' @param alpha_crit_val critical value to be used for the testing (on the probability scale)
#' @param simple boolean variable, defining whether simplified fit will be applied. Passed to the getModelFits function. Default FALSE.
#' @param reestimate tbd Default FALSE
#' @param contr tbd Default NULL
#' @param dr_means tbd Default NULL
#'
#' @export
assessDesign <- function (
Expand Down Expand Up @@ -98,8 +102,10 @@ assessDesign <- function (
#'
#' @param mods An object of class "Mods" as specified in the Dosefinding package.
#' @param dose_levels vector containing the different doseage levels.
#' @param dose_weights Vector specifying weights for the different doses
#' @param prior_list a prior_list object
#' @param dose_weights Vector specifying weights for the different doses. Default NULL
#' @param prior_list a prior_list object. Default NULL
#' @param sd_posterior tbd. Default NULL
#' @param se_new_trial tbd. Default NULL
#'
#' @return contr Object of class ‘⁠optContr⁠’. A list containing entries contMat and muMat, and CorrMat. Specified in the Dosefinding package.
#'
Expand Down Expand Up @@ -196,7 +202,7 @@ getCritProb <- function (
doses = dose_levels,
w = dose_weights)

crit_prob <- pnorm(DoseFinding:::critVal(
crit_prob <- stats::pnorm(DoseFinding::critVal(
corMat = contr$corMat,
alpha = alpha_crit_val,
df = 0,
Expand All @@ -212,7 +218,7 @@ getCritProb <- function (
#'
#' @param posterior_list a getPosterior object
#' @param contr a getContrMat object, contrast matrix to be used for the testing step.
#' @param crit_prob a getCritProb object
#' @param crit_prob_adj a getCritProb object
#' @param simple boolean variable, defining whether simplified fit will be applied. Passed to the getModelFits function. Default FALSE.
#'
#' @return bmcpmod test result as well as modelling result.
Expand All @@ -227,7 +233,7 @@ performBayesianMCPMod <- function (

) {

if (class(posterior_list) == "postList") {
if (inherits(posterior_list, "postList")) {

posterior_list <- list(posterior_list)

Expand Down Expand Up @@ -310,7 +316,7 @@ addSignificance <- function (
#'
#' @param posterior_list a getPosterior object
#' @param contr a getContrMat object, contrast matrix to be used for the testing step.
#' @param crit_prob a getCritProb object, specifying the critical value to be used for the testing (on the probability scale)
#' @param crit_prob_adj a getCritProb object, specifying the critical value to be used for the testing (on the probability scale)
#'
#' @return b_mcp test result
#'
Expand All @@ -323,7 +329,7 @@ performBayesianMCP <- function(

) {

if (class(posterior_list) == "postList") {
if (inherits(posterior_list, "postList")) {

posterior_list <- list(posterior_list)

Expand Down
4 changes: 2 additions & 2 deletions R/bootstrapping.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' @title getBootstrapQuantiles
#'
#' @param model_fits tbd
#' @param quantiles tbd
#' @param n_samples tbd
#' @param alpha tbd
#' @param avg_fit tbd
#' @param doses tbd
#' @param avg_fit tbd
#'
#' @return tbd
#' @export
Expand Down
7 changes: 4 additions & 3 deletions R/posterior.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
#'
#' @description Either the patient level data or both the mu_hat as well as the sd_hat must to be provided.
#'
#' @param data dataframe containing the information of dose and response.
#' Also a simulateData object can be provided.
#' @param prior_list prior_list object
#' @param data dataframe containing the information of dose and response. Default NULL
#' Also a simulateData object can be provided.
#' @param mu_hat vector of estimated mean values
#' @param sd_hat vector of estimated standard deviations.
#' @param se_hat vector of estimated standard deviations.
#' @param calc_ess tbd. Default NULL
#'
#' @export
getPosterior <- function(
Expand Down
1 change: 1 addition & 0 deletions R/simulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#' @param true_model Default value is NULL.
#' Assumed true underlying model. Provided via a String. e.g. "emax".
#' In case of NULL, all dose-response models, included in the mods input parameter will be used.
#' @param dr_means tbd. Default NULL.
#'
#' @return sim_data one list object, containing patient level simulated data for all assumed true models.
#' Also providing information about simulation iteration, patient number as well as dosage levels.
Expand Down
8 changes: 8 additions & 0 deletions man/assessDesign.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/getBootstrapQuantiles.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/getContr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/getPosterior.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/performBayesianMCP.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/performBayesianMCPMod.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/simulateData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ea587f

Please sign in to comment.