We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
map_df*()
1 parent 07525af commit e7f7b41Copy full SHA for e7f7b41
NAMESPACE
@@ -359,8 +359,6 @@ importFrom(purrr,imap_lgl)
359
importFrom(purrr,map)
360
importFrom(purrr,map_chr)
361
importFrom(purrr,map_dbl)
362
-importFrom(purrr,map_df)
363
-importFrom(purrr,map_dfr)
364
importFrom(purrr,map_lgl)
365
importFrom(rlang,abort)
366
importFrom(rlang,call2)
R/aaa_models.R
@@ -957,10 +957,11 @@ show_model_info <- function(model) {
957
cat(" engines: \n")
958
959
weight_info <-
960
- purrr::map_df(
+ purrr::map(
961
model,
962
~ get_from_env(paste0(.x, "_fit")) %>% mutate(model = .x)
963
) %>%
964
+ purrr::list_rbind() %>%
965
dplyr::mutate(protect = map(value, ~ .x$protect)) %>%
966
dplyr::select(-value) %>%
967
dplyr::mutate(
R/boost_tree.R
@@ -492,8 +492,10 @@ multi_predict._xgb.Booster <-
492
type <- "numeric"
493
}
494
495
- res <- map_df(trees, xgb_by_tree, object = object, new_data = new_data,
496
- type = type, ...)
+ res <-
+ map(trees, xgb_by_tree, object = object, new_data = new_data,
497
+ type = type, ...) %>%
498
+ purrr::list_rbind()
499
res <- arrange(res, .row, trees)
500
res <- split(res[, -1], res$.row)
501
names(res) <- NULL
@@ -612,8 +614,9 @@ multi_predict._C5.0 <-
612
614
type <- "class"
613
615
616
res <-
- map_df(trees, C50_by_tree, object = object,
- new_data = new_data, type = type, ...)
617
+ map(trees, C50_by_tree, object = object,
618
+ new_data = new_data, type = type, ...) %>%
619
620
621
622
R/engine_docs.R
@@ -77,14 +77,16 @@ extensions <- function() {
77
update_model_info_file <- function(path = "inst/models.tsv") {
78
mods <- get_from_env("models")
79
info <-
80
- purrr::map_dfr(mods, ~ get_from_env(.x) %>% dplyr::mutate(model = .x)) %>%
+ purrr::map(mods, ~ get_from_env(.x) %>% dplyr::mutate(model = .x)) %>%
81
82
dplyr::arrange(model, mode, engine) %>%
83
dplyr::select(model, mode, engine)
84
exts <-
- purrr::map_dfr(
85
86
mods,
87
~ get_from_env(paste0(.x, "_pkgs")) %>% dplyr::mutate(model = .x)
88
89
90
tidyr::unnest(cols = "pkg") %>%
91
dplyr::inner_join(tibble::tibble(pkg = extensions()), by = "pkg")
92
@@ -310,5 +312,5 @@ list_md_problems <- function() {
310
312
tibble(basename(file), line, problem)
311
313
314
- purrr::map_dfr(md_files, get_errors)
315
+ purrr::map(md_files, get_errors) %>% purrr::list_rbind()
316
R/install_packages.R
@@ -14,10 +14,11 @@ install_engine_packages <- function(extension = TRUE, extras = TRUE,
14
bio_pkgs <- c(bio_pkgs, "mixOmics")
15
16
17
- engine_packages <- purrr::map_dfr(
+ engine_packages <- purrr::map(
18
ls(envir = get_model_env(), pattern = "_pkgs$"),
19
get_from_env
20
21
22
dplyr::pull(pkg) %>%
23
unlist() %>%
24
unique() %>%
R/mars.R
@@ -126,7 +126,8 @@ check_args.mars <- function(object) {
126
127
earth_submodel_pred <- function(object, new_data, terms = 2:3, ...) {
128
load_libs(object, quiet = TRUE, attach = TRUE)
129
- map_dfr(terms, earth_reg_updater, object = object, newdata = new_data, ...)
+ map(terms, earth_reg_updater, object = object, newdata = new_data, ...) %>%
130
131
132
133
earth_reg_updater <- function(num, object, new_data, ...) {
@@ -184,8 +185,9 @@ multi_predict._earth <-
184
185
186
187
- map_df(num_terms, earth_by_terms, object = object,
188
+ map(num_terms, earth_by_terms, object = object,
189
190
191
res <- arrange(res, .row, num_terms)
192
193
R/mlp.R
@@ -359,7 +359,7 @@ mlp_num_weights <- function(p, hidden_units, classes) {
## -----------------------------------------------------------------------------
-#' @importFrom purrr map_df map
+#' @importFrom purrr map
#' @importFrom dplyr arrange select
#' @rdname multi_predict
#' @param epochs An integer vector for the number of training epochs.
@@ -384,7 +384,8 @@ multi_predict._torch_mlp <-
384
purrr::map(epochs,
385
~ predict(object, new_data, type, epochs = .x) %>%
386
dplyr::mutate(epochs = .x)) %>%
387
- purrr::map_dfr(~ .x %>% dplyr::mutate(.row = 1:nrow(new_data))) %>%
+ purrr::map(~ .x %>% dplyr::mutate(.row = 1:nrow(new_data))) %>%
388
389
dplyr::arrange(.row, epochs)
390
res <- split(dplyr::select(res, -.row), res$.row)
391
R/nearest_neighbor.R
@@ -161,8 +161,9 @@ multi_predict._train.kknn <-
161
162
163
164
- purrr::map_df(neighbors, knn_by_k, object = object,
165
+ purrr::map(neighbors, knn_by_k, object = object,
166
167
res <- dplyr::arrange(res, .row, neighbors)
168
169
R/parsnip-package.R
@@ -15,7 +15,7 @@
#' @importFrom glue glue_collapse
#' @importFrom lifecycle deprecated
#' @importFrom pillar type_sum
-#' @importFrom purrr as_vector imap imap_lgl map map_chr map_dbl map_df map_dfr
+#' @importFrom purrr as_vector imap imap_lgl map map_chr map_dbl
#' @importFrom purrr map_lgl %||%
#' @importFrom rlang abort call2 caller_env current_env enquo enquos eval_tidy
#' @importFrom rlang expr get_expr is_empty is_missing is_null is_quosure
R/varying.R
@@ -112,7 +112,7 @@ varying_args.recipe <- function(object, full = TRUE, ...) {
112
return(varying_tbl())
113
114
115
- map_dfr(object$steps, varying_args, full = full)
+ map(object$steps, varying_args, full = full) %>% purrr::list_rbind()
116
117
118
#' @export
0 commit comments