View source: R/splitted_transmute.R
splitted_transmute | R Documentation |
Splits the data.frame into separeta parts and evaluates it one-by-one. Useful for saving memmory during large computations.
splitted_transmute(
.data,
...,
split_number = 100,
.keep = NULL,
.progress = TRUE
)
.data |
Data frame. |
... |
arguments to pass transmute(...). |
split_number |
Number of parts to split the data.frame before evaluation. |
.keep |
Variables to keep after eval the expression. All newly created columns are keept automaticly. |
iris_samples <- tibble(data = replicate(100, sample_n(iris, 50), simplify = FALSE))
iris_samples
iris_samples %>%
splitted_transmute(
fit = map(data, lm, formula = Sepal.Length ~ Sepal.Width),
coefs = map(fit, "coefficients"),
coef1 = map_dbl(coefs, 1),
coef2 = map_dbl(coefs, 2),
.keep = c("coef1", "coef2") # single core
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.