Skip to contents

Splits the combined data frame from a barn object back into a named list containing the preprocessed predictors.

Usage

harvest(barn_obj)

Arguments

barn_obj

An object of class "barn", created by barn().

Value

A named list of data frames, one for each dataset originally passed to barn().

Examples

full <- data.frame(id = 1:3, p1 = c("A", "B", "C"), p2 = 10:12, y = 1:3)
holdout <- data.frame(id = 4:5, p1 = c("D", "E"), p2 = 1:2)
original <- data.frame(id = 1:2, p1 = c("F", "G"), p2 = 3:4, y = 4:5)
harvested <- barn(full, holdout) |> harvest()
names(harvested)
#> [1] "full"    "holdout"
harvested[["full"]]
#>   id p1 p2
#> 1  1  A 10
#> 2  2  B 11
#> 3  3  C 12