Skip to content

Commit 4be5c26

Browse files
authored
Merge pull request #23 from weberse2/issue-prep-1-8-0-release
1.8-0 release
2 parents bb34961 + 505171b commit 4be5c26

File tree

125 files changed

+8689
-7646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+8689
-7646
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Description: Tool-set to support Bayesian evidence synthesis. This
88
for details on applying this package while Neuenschwander et al. (2010)
99
<doi:10.1177/1740774509356002> and Schmidli et al. (2014)
1010
<doi:10.1111/biom.12242> explain details on the methodology.
11-
Version: 1.7-4
12-
Date: 2024-11-21
11+
Version: 1.8-0
12+
Date: 2025-01-08
1313
Authors@R: c(person("Novartis", "Pharma AG", role = "cph")
1414
,person("Sebastian", "Weber", email="[email protected]", role=c("aut", "cre"))
1515
,person("Beat", "Neuenschwander", email="[email protected]", role="ctb")

Makefile

+23-2
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ all : $(TARGET)
4949
cd $(@D); echo running $(RCMD) -e "rmarkdown::render('$(<F)', output_format=rmarkdown::html_document(self_contained=TRUE))"
5050
cd $(@D); $(RCMD) -e "rmarkdown::render('$(<F)', output_format=rmarkdown::html_document(self_contained=TRUE))"
5151

52-
tests/%.Rtest : tests/%.R
52+
tests/%.Rtest : tests/%.R $(R_PKG_SRCS) NAMESPACE
5353
NOT_CRAN=true $(RCMD) -e "devtools::load_all()" -e "test_file('$<')" > $@ 2>&1
5454
@printf "Test summary for $(<F): "
5555
@grep '^\[' $@ | tail -n 1
5656

57-
tests/%.Rtestfast : tests/%.R
57+
tests/%.Rtestfast : tests/%.R $(R_PKG_SRCS) NAMESPACE
5858
NOT_CRAN=false $(RCMD) -e "devtools::load_all()" -e "test_file('$<')" > $@ 2>&1
5959
@printf "Test summary for $(<F): "
6060
@grep '^\[' $@ | tail -n 1
@@ -181,6 +181,27 @@ retestfast-all : clean-test $(R_TESTFAST_OBJS)
181181
PHONY += retest-all
182182
retest-all : clean-test $(R_TEST_OBJS)
183183

184+
PHONY += check-winbuilder-devel
185+
check-winbuilder-devel : r-source-release
186+
cd build; $(RCMD) -e 'target <- tempdir()' \
187+
-e 'untar("$(RPKG)_$(PKG_VERSION).tar.gz", exdir=target)' \
188+
-e 'devtools::check_win_devel(pkg=file.path(target, "RBesT"))'
189+
190+
PHONY += check-winbuilder-release
191+
check-winbuilder-release : r-source-release
192+
cd build; $(RCMD) -e 'target <- tempdir()' \
193+
-e 'untar("$(RPKG)_$(PKG_VERSION).tar.gz", exdir=target)' \
194+
-e 'devtools::check_win_release(pkg=file.path(target, "RBesT"))'
195+
196+
PHONY += check-winbuilder-oldrelease
197+
check-winbuilder-oldrelease : r-source-release
198+
cd build; $(RCMD) -e 'target <- tempdir()' \
199+
-e 'untar("$(RPKG)_$(PKG_VERSION).tar.gz", exdir=target)' \
200+
-e 'devtools::check_win_oldrelease(pkg=file.path(target, "RBesT"))'
201+
202+
PHONY += check-winbuilder
203+
check-winbuilder : check-winbuilder-devel check-winbuilder-release check-winbuilder-oldrelease
204+
184205
#$(DIR_OBJ)/%.o: %.c $(INCS)
185206
# mkdir -p $(@D)
186207
# $(CC) -o $@ $(CFLAGS) -c $< $(INC_DIRS)

NEWS.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# RBesT 1.8-0 - January 8th, 2025
2+
3+
## Enhancements
4+
5+
* Enable ESS calculation for normal mixture densities when used in the
6+
context of a standard one-parameter exponential family through the
7+
new `family` argument. For example, this can be used to calculate
8+
the ESS of a normal mixture density representing a logit transformed
9+
response scale.
10+
* Reformat R sources using `styler`.
11+
12+
## Bugfixes
13+
14+
* Correct boundary behavior of `BinaryExactCI` function whenever no
15+
responses or no non-responses are observed. Fixes issue #21.
16+
* Stabilize internal beta mixture information function, which corrects
17+
unstable ESS ELIR computations. Addresses issue #22.
18+
119
# RBesT 1.7-4 - November 21st, 2024
220

321
## Enhancements

R/AS.R

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
#' @template example-start
1818
#' @examples
1919
#' set.seed(34563)
20-
#' map_AS <- gMAP(cbind(r, n-r) ~ 1 | study,
21-
#' family=binomial,
22-
#' data=AS,
23-
#' tau.dist="HalfNormal", tau.prior=1,
24-
#' beta.prior=2)
20+
#' map_AS <- gMAP(cbind(r, n - r) ~ 1 | study,
21+
#' family = binomial,
22+
#' data = AS,
23+
#' tau.dist = "HalfNormal", tau.prior = 1,
24+
#' beta.prior = 2
25+
#' )
2526
#' @template example-stop
2627
"AS"

R/BinaryExactCI.R

+21-23
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,42 @@
33
#' This function calculates the exact confidendence interval for a
44
#' response rate presented by \eqn{n} and \eqn{r}.
55
#'
6-
#' @param r Number of success or responder
6+
#' @param r Number of success or responder
77
#' @param n Sample size
88
#' @param alpha confidence level
99
#' @param drop Determines if \code{\link{drop}} will be called on the result
10-
#'
10+
#'
1111
#' @details
12-
#' Confidence intervals are obtained by a procedure first given in
13-
#' Clopper and Pearson (1934). This guarantees that the confidence
12+
#' Confidence intervals are obtained by a procedure first given in
13+
#' Clopper and Pearson (1934). This guarantees that the confidence
1414
#' level is at least (1-\eqn{\alpha}).
1515
#'
1616
#' Details can be found in the publication listed below.
17-
#'
17+
#'
1818
#' @return 100 (1-\eqn{\alpha})\% exact confidence interval for given
1919
#' response rate
2020
#'
2121
#' @references Clopper, C. J. & Pearson, E. S. The use of confidence or
22-
#' fiducial limits illustrated in the case of the binomial. Biometrika 1934.
23-
#'
22+
#' fiducial limits illustrated in the case of the binomial. Biometrika 1934.
23+
#'
2424
#' @examples
25-
#' BinaryExactCI(3,20,0.05)
26-
#'
25+
#' BinaryExactCI(3, 20, 0.05)
26+
#'
2727
#' @export
28-
BinaryExactCI <- function(r, n, alpha=0.05, drop=TRUE) {
29-
alpha2 <- alpha/2
30-
Low <- alpha2
31-
High <- 1-alpha2
32-
33-
pLow <- qbeta( Low, r+(r==0), n-r+1)
34-
pHigh <- qbeta( High, r+1, n-r+((n-r)==0))
28+
BinaryExactCI <- function(r, n, alpha = 0.05, drop = TRUE) {
29+
alpha2 <- alpha / 2
30+
Low <- alpha2
31+
High <- 1 - alpha2
3532

36-
nms <- c( paste(round(100*Low,1),"%",sep=""),paste(round(100*High,1),"%",sep="") )
33+
pLow <- qbeta(Low, r, n - r + 1)
34+
pHigh <- qbeta(High, r + 1, n - r)
3735

38-
CI <- cbind(pLow,pHigh)
39-
colnames(CI) <- nms
36+
nms <- c(paste(round(100 * Low, 1), "%", sep = ""), paste(round(100 * High, 1), "%", sep = ""))
4037

41-
if(drop) CI <- drop(CI)
42-
43-
return( CI )
44-
}
38+
CI <- cbind(pLow, pHigh)
39+
colnames(CI) <- nms
4540

41+
if (drop) CI <- drop(CI)
4642

43+
return(CI)
44+
}

R/Curry.R

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#' Functional programming utilities
2-
#'
2+
#'
33
#' function from functional
4-
#'
4+
#'
55
#' @keywords internal
6-
Curry <- function (FUN, ...)
7-
{
8-
.orig = list(...)
9-
function(...) do.call(FUN, c(.orig, list(...)))
6+
Curry <- function(FUN, ...) {
7+
.orig <- list(...)
8+
function(...) do.call(FUN, c(.orig, list(...)))
109
}

0 commit comments

Comments
 (0)