The behavior of map is understood to the extent of the following code.
iris %>%
group_nest(Species) %>%
mutate(lm_mod = map(data,function(x){
lm(Sepal.Width~Sepal.Length,x)
}))
The above code works in my head as follows.
fot(i in unique(iris$species))
data <- slice iris$species[i]
function(data){lm(width ~ length,data)}
lm_mod[i] <- function(data)
But I'm confused when I encounter new code.
folds %>%
mutate(recipes = map(splits, prepper, recipe = recipe_code))
in my head
for(i in len(folds))
folds$recipes <- prepper(splits) ??recipe = recipe_code??
Where does the recipe_code go in?