Skip to content
Merged
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/crossvalidation.R
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ applyFolds <- function(object, folds = cv(rep(1, length(unique(object$id))), typ
OOBweights <- matrix(rep(sample_weights, ncol(folds)), ncol = ncol(folds))
OOBweights[folds > 0] <- 0

if (all.equal(papply, mclapply) == TRUE) {
if (isTRUE(all.equal(papply, mclapply))) {
oobrisk <- papply(1:ncol(folds),
function(i) try(dummyfct(weights = folds[, i],
oobweights = OOBweights[, i]),
Expand Down
4 changes: 2 additions & 2 deletions R/utilityFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ reweightData <- function(data, argvals, vars,

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

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

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

## subset hmatrix
Expand Down