Skip to content

Commit 9dbf096

Browse files
committed
refactor: use isTRUE(all.equal()) instead of all.equal() for checking boolean
1 parent 2dd23a7 commit 9dbf096

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

R/crossvalidation.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ applyFolds <- function(object, folds = cv(rep(1, length(unique(object$id))), typ
505505
OOBweights <- matrix(rep(sample_weights, ncol(folds)), ncol = ncol(folds))
506506
OOBweights[folds > 0] <- 0
507507

508-
if (all.equal(papply, mclapply) == TRUE) {
508+
if (isTRUE(all.equal(papply, mclapply))) {
509509
oobrisk <- papply(1:ncol(folds),
510510
function(i) try(dummyfct(weights = folds[, i],
511511
oobweights = OOBweights[, i]),

R/utilityFunctions.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ reweightData <- function(data, argvals, vars,
11071107

11081108
## check that all idvars are equal
11091109
if(length(idvars)>1)
1110-
if(!all(sapply(data[idvars][-1],function(x)all.equal(data[idvars][[1]],x)=="TRUE")))
1110+
if(!all(sapply(data[idvars][-1],function(x) isTRUE(all.equal(data[idvars][[1]], x)))))
11111111
stop("All idvars must be identical.")
11121112
idvars_new <- NULL
11131113

@@ -1131,7 +1131,7 @@ reweightData <- function(data, argvals, vars,
11311131
for(j in 1:length(nhm)){
11321132

11331133
## check that idvars == idvars[[1]] and match id-variables in all hmatrix-objects
1134-
if(!is.null(idvars) && !(all.equal(c(getId(data[[nhm[j]]])), c(data[[idvars[1]]])) == "TRUE"))
1134+
if(!is.null(idvars) && !isTRUE(all.equal(c(getId(data[[nhm[j]]])), c(data[[idvars[1]]]))))
11351135
stop("id variable in hmatrix object must be equal to idvars")
11361136

11371137
## subset hmatrix

0 commit comments

Comments
 (0)