Skip to content

Commit

Permalink
Merge pull request #61 from billdenney/styling
Browse files Browse the repository at this point in the history
Styling
  • Loading branch information
certara-jcraig authored Jun 3, 2024
2 parents 528d406 + 605f5c1 commit 8590d6c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R/vpcstats_fun.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ vpcstats.tidyvpcobj <- function(o, vpc.type =c("continuous", "categorical"), qpr
"A binning method should be specified through binning() or binless() execution before vpcstats() run."
)
}

stopifnot(length(qpred) == 3)

repl <- ypc <- ypcvc <- y <- x <- blq <- lloq <- alq <- uloq <- NULL
Expand All @@ -61,8 +61,8 @@ vpcstats.tidyvpcobj <- function(o, vpc.type =c("continuous", "categorical"), qpr

ylvls <- sort(unique(obs$y))

# categorical binless vpcstats() ----
if(method$method == "binless"){
# categorical binless vpcstats() ----
xobs <- obs$x
xsim <- sim$x
sp <- method$sp
Expand Down Expand Up @@ -153,7 +153,7 @@ vpcstats.tidyvpcobj <- function(o, vpc.type =c("continuous", "categorical"), qpr
stop("Need to specify binning before calling vpcstats.")
}
if (any(is.na(stratbin$bin))) {
warning("There are bins missing. Has binning been specified for all strata?", call.=F)
warning("There are bins missing. Has binning been specified for all strata?", call.=FALSE)
}

.stratbinrepl <- data.table(stratbin, sim[, .(repl)])
Expand Down Expand Up @@ -187,8 +187,8 @@ vpcstats.tidyvpcobj <- function(o, vpc.type =c("continuous", "categorical"), qpr
}
# update vpc
update(o, stats=stats, conf.level=conf.level, vpc.type = type, vpc.method = method)
# continuous vpcstats ----
} else {
# continuous vpcstats ----
if(method$method == "binless") {
.binlessvpcstats(o, qpred=qpred, conf.level=conf.level, quantile.type=quantile.type, vpc.type = type, vpc.method = method)
} else {
Expand All @@ -204,14 +204,14 @@ vpcstats.tidyvpcobj <- function(o, vpc.type =c("continuous", "categorical"), qpr

if (isTRUE(predcor)) {
if (isTRUE(varcorr)) {
qobs <- obs[, quant_loq(ypcvc, probs=qpred, blq=blq, alq=alq, type = quantile.type), by=stratbin]
qobs <- obs[, quant_loq(ypcvc, probs=qpred, blq=blq, alq=alq, type = quantile.type), by=stratbin]
qsim <- sim[, quant_loq(ypcvc, probs=qpred, blq=FALSE, alq=FALSE, type = quantile.type), by=.stratbinrepl]
} else {
qobs <- obs[, quant_loq(ypc, probs=qpred, blq=blq, alq=alq, type = quantile.type), by=stratbin]
qobs <- obs[, quant_loq(ypc, probs=qpred, blq=blq, alq=alq, type = quantile.type), by=stratbin]
qsim <- sim[, quant_loq(ypc, probs=qpred, blq=FALSE, alq=FALSE, type = quantile.type), by=.stratbinrepl]
}
} else {
qobs <- obs[, quant_loq(y, probs=qpred, blq=blq, alq=alq , type = quantile.type), by=stratbin]
qobs <- obs[, quant_loq(y, probs=qpred, blq=blq, alq=alq, type = quantile.type), by=stratbin]
qsim <- sim[, quant_loq(y, probs=qpred, blq=FALSE, alq=FALSE, type = quantile.type), by=.stratbinrepl]
}

Expand Down

0 comments on commit 8590d6c

Please sign in to comment.