Skip to content

Commit

Permalink
- added citation file
Browse files Browse the repository at this point in the history
- added word list file
- further CRAN fixes: shortened example runtime
  • Loading branch information
wojcieko committed Dec 28, 2023
1 parent 9e29868 commit 7bac310
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 41 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ docs
^doc$
^Meta$
^cran-comments\.md$
^cran_submission_script\.R$
1 change: 1 addition & 0 deletions BayesianMCPMod.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ LaTeX: pdfLaTeX
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: BayesianMCPMod
Title: Simulate, Evaluate, and Analyze Dose Finding Trials with Bayesian
MCPMod
Version: 0.1.5
Version: 1.0.0
Authors@R: c(
person("Boehringer Ingelheim Pharma GmbH & Co. KG", role = c("cph", "fnd")),
person("Stephan", "Wojciekowski", , "[email protected]", role = c("aut", "cre")),
Expand Down
18 changes: 6 additions & 12 deletions R/bootstrapping.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,17 @@
#' DG_2 = RBesT::mixnorm(comp1 = c(w = 1, m = 4, s = 1.5), sigma = 2) ,
#' DG_3 = RBesT::mixnorm(comp1 = c(w = 1, m = 6, s = 1.2), sigma = 2) ,
#' DG_4 = RBesT::mixnorm(comp1 = c(w = 1, m = 6.5, s = 1.1), sigma = 2))
#' models <- c("emax", "exponential", "sigEmax", "linear")
#' models <- c("exponential", "linear")
#' dose_levels <- c(0, 1, 2, 4, 8)
#' fit <- getModelFits(models = models,
#' posterior = posterior_list,
#' dose_levels = dose_levels)
#' fit_simple <- getModelFits(models = models,
#' posterior = posterior_list,
#' dose_levels = dose_levels,
#' simple = TRUE)
#' dose_levels = dose_levels,
#' simple = TRUE)
#'
#' getBootstrapQuantiles(model_fits = fit,
#' quantiles = c(0.025, 0.5, 0.975),
#' n_samples = 100, # not recommended, speeding up example
#' doses = c(0, 1, 2, 3, 4, 6, 8))
#' # getBootstrapQuantiles(model_fits = fit_simple,
#' # quantiles = c(0.025, 0.5, 0.975),
#' # n_samples = 2000,
#' # doses = c(0, 1, 2, 3, 4, 6, 8))
#' n_samples = 100, # speeding up example run time
#' doses = c(0, 6, 8))
#' @return A data frame with entries doses, models, and quantiles
#' @export
getBootstrapQuantiles <- function (
Expand Down
12 changes: 4 additions & 8 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@
#' DG_2 = RBesT::mixnorm(comp1 = c(w = 1, m = 4, s = 1.5), sigma = 2) ,
#' DG_3 = RBesT::mixnorm(comp1 = c(w = 1, m = 6, s = 1.2), sigma = 2) ,
#' DG_4 = RBesT::mixnorm(comp1 = c(w = 1, m = 6.5, s = 1.1), sigma = 2))
#' models <- c("emax", "exponential", "sigEmax", "linear")
#' models <- c("exponential", "linear")
#' dose_levels <- c(0, 1, 2, 4, 8)
#' fit <- getModelFits(models = models,
#' posterior = posterior_list,
#' dose_levels = dose_levels)
#' fit_simple <- getModelFits(models = models,
#' posterior = posterior_list,
#' dose_levels = dose_levels,
#' simple = TRUE)
#' dose_levels = dose_levels,
#' simple = TRUE)
#'
#' plot(fit, cr_bands = TRUE)
#' # plot(fit_simple, cr_bands = TRUE, alpha_CrB = c(0.05, 0.1, 0.5))
#' plot(fit)
#' @return A ggplot2 object
#' @export
plot.modelFits <- function (
Expand Down
70 changes: 70 additions & 0 deletions cran_submission_script.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
usethis::use_build_ignore(c(".github", "_pkgdown.yml", "dev", "cran_submission_script.R"))


# Update dependencies in DESCRIPTION
# install.packages('attachment', repos = 'https://thinkr-open.r-universe.dev')
attachment::att_amend_desc()

# Run tests and examples
devtools::test()
devtools::run_examples()
# autotest::autotest_package(test = TRUE)

# Check package as CRAN
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"))

# Check content
# install.packages('checkhelper', repos = 'https://thinkr-open.r-universe.dev')
checkhelper::find_missing_tags()
# _Check that you let the house clean after the check, examples and tests
all_files_remaining <- checkhelper::check_clean_userspace()
all_files_remaining

# Check spelling
# usethis::use_spell_check()
spelling::spell_check_package()

# Check URL are correct
# install.packages('urlchecker', repos = 'https://r-lib.r-universe.dev')
urlchecker::url_check()
urlchecker::url_update()

# check on other distributions
# _rhub
devtools::check_rhub()
rhub::check_on_windows(check_args = "--force-multiarch")
rhub::check_on_solaris()
# _win devel CRAN
devtools::check_win_devel()
# _macos CRAN
devtools::check_mac_release()

# Check reverse dependencies
# remotes::install_github("r-lib/revdepcheck")
install.packages('revdepcheck', repos = 'https://r-lib.r-universe.dev')
usethis::use_git_ignore("revdep/")
usethis::use_build_ignore("revdep/")

devtools::revdep()
library(revdepcheck)
# In another session
id <- rstudioapi::terminalExecute("Rscript -e 'revdepcheck::revdep_check(num_workers = 4)'")
rstudioapi::terminalKill(id)
# See outputs
revdep_details(revdep = "pkg")
revdep_summary() # table of results by package
revdep_report() # in revdep/
# Clean up when on CRAN
revdep_reset()

# Update NEWS
# Bump version manually and add list of changes

# Add comments for CRAN
usethis::use_cran_comments(open = rlang::is_interactive())

# Upgrade version number
usethis::use_version(which = c("patch", "minor", "major", "dev")[1])

# Verify you're ready for release, and release
devtools::release()
20 changes: 20 additions & 0 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
citHeader("To cite BayesianMCPMod in publications, please use:")

year <- sub("-.*", "", meta$Date)
note <- sprintf("R package version %s", meta$Version)

bibentry(
bibtype = "Manual",
title = "BayesianMCPMod: Simulate, Evaluate, and Analyze Dose Finding Trials with Bayesian MCPMod",
author = c(
person("Stephan", "Wojciekowski"),
person("Lars", "Andersen"),
person("Sebastian", "Bossert")
),
year = year,
note = note,
url = "https://CRAN.R-project.org/package=bhmbasket",
textVersion = paste0(
"Wojciekowski, S, Andersen, L, Bossert, S (", year, "). BayesianMCPMod: Simulate, Evaluate, and Analyze Dose Finding Trials with Bayesian MCPMod. ", note, "."
)
)
5 changes: 5 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MCPMod
Pinheiro
Schmidli
al
et
18 changes: 6 additions & 12 deletions man/getBootstrapQuantiles.Rd

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

12 changes: 4 additions & 8 deletions man/plot.modelFits.Rd

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

0 comments on commit 7bac310

Please sign in to comment.