Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/ocPredprob.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ h_get_decision_one_predprob <- function(nnr, truep, p0, parE = c(1, 1), nnE, nnF
thetaT = tT,
parE = parE
)$result
decision <- ifelse(interim_qU > phiU, FALSE, decision)
decision <- ifelse(interim_qU > phiU, TRUE, decision)
all_looks <- orig_nnr[index_look]
}
if (size_look %in% nnF) {
Expand Down
85 changes: 63 additions & 22 deletions R/plotBounds.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@
#' @example examples/plotBounds.R
#' @export
#' @keywords graphics
plotBounds <- function(z, area = TRUE, grid = TRUE, yt = "x", add = FALSE,
cols = c("green", "red", "darkgreen", "orange"),
lwds = c(3, 3), ltype = "l", lpch = 16, lcex = 1, gy = 20) {
plotBounds <- function(
z,
area = TRUE,
grid = TRUE,
yt = "x",
add = FALSE,
cols = c("green", "red", "darkgreen", "orange"),
lwds = c(3, 3),
ltype = "l",
lpch = 16,
lcex = 1,
gy = 20
) {
n <- nrow(z)
nmin <- min(z$looks)
nmax <- max(z$looks)
Expand All @@ -51,40 +61,71 @@ plotBounds <- function(z, area = TRUE, grid = TRUE, yt = "x", add = FALSE,
stop("yt can only be x or p")
}
if (add) {
graphics::lines(z$looks, z2,
lwd = lwds[1], col = cols[3], type = ltype,
pch = lpch, cex = lcex
graphics::lines(
z$looks,
z2,
lwd = lwds[1],
col = cols[3],
type = ltype,
pch = lpch,
cex = lcex
)
graphics::lines(z$looks, z1,
lwd = lwds[2], col = cols[4], type = ltype,
pch = lpch, cex = lcex
graphics::lines(
z$looks,
z1,
lwd = lwds[2],
col = cols[4],
type = ltype,
pch = lpch,
cex = lcex
)
return(invisible())
}
graphics::plot(z$looks, rep(0, n),
xlim = c(0, max(z$looks)), ylim = c(0, yU), type = "n",
xlab = "n", ylab = ylabel
graphics::plot(
z$looks,
rep(0, n),
xlim = c(0, max(z$looks)),
ylim = c(0, yU),
type = "n",
xlab = "n",
ylab = ylabel
)
if (grid) {
graphics::abline(h = gridy, col = "gray")
}
if (area) {
graphics::polygon(c(z$looks, nmax, nmin), c(z2, yU, yU2),
graphics::polygon(
c(z$looks, nmax, nmin),
c(z2, yU, yU2),
lwd = lwds[1],
col = cols[1], border = cols[1]
col = cols[1],
border = cols[1]
)
graphics::polygon(c(z$looks, nmax, nmin), c(z1, 0, 0),
graphics::polygon(
c(z$looks, nmax, nmin),
c(z1, 0, 0),
lwd = lwds[2],
col = cols[2], border = cols[2]
col = cols[2],
border = cols[2]
)
} else {
graphics::lines(z$looks, z2,
lwd = lwds[1], col = cols[1], type = ltype,
pch = lpch, cex = lcex
graphics::lines(
z$looks,
z2,
lwd = lwds[1],
col = cols[1],
type = ltype,
pch = lpch,
cex = lcex
)
graphics::lines(z$looks, z1,
lwd = lwds[2], col = cols[2], type = ltype,
pch = lpch, cex = lcex
graphics::lines(
z$looks,
z1,
lwd = lwds[2],
col = cols[2],
type = ltype,
pch = lpch,
cex = lcex
)
}
return(invisible())
Expand Down
Loading