[R-package] remove dependency on {magrittr} (#6928)

Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
James Lamb
2021-05-12 15:34:59 -05:00
committed by GitHub
parent 44cc9c04ea
commit 894e9bc5d4
14 changed files with 131 additions and 66 deletions

View File

@@ -642,8 +642,13 @@ cb.gblinear.history <- function(sparse=FALSE) {
coefs <<- list2mat(coefs)
} else { # xgb.cv:
# first lapply transposes the list
coefs <<- lapply(seq_along(coefs[[1]]), function(i) lapply(coefs, "[[", i)) %>%
lapply(function(x) list2mat(x))
coefs <<- lapply(
X = lapply(
X = seq_along(coefs[[1]]),
FUN = function(i) lapply(coefs, "[[", i)
),
FUN = function(x) list2mat(x)
)
}
}