Combine multiple data frames based on their common columns.
That's the first step for preprocessing with the barn
package.
When printing it shows the characteristics of the combined datasets.
Usage
barn(..., nominal_sufix = "_cat", numeric_sufix = "_num")
# S3 method for class 'barn'
print(x, form_width = 30, ...)
Arguments
- ...
Extra arguments.
- nominal_sufix
An optional string for dealing with nominal variables. Defaults to "_cat".
- numeric_sufix
An optional string for dealing with numeric variables. Defaults to "_num".
- x
An object of class "barn".
- form_width
An integer specifying the minimum column width (in characters). Default is 30.
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)
print(barn(full, holdout, original))
#>
#> ── Barn ──────────────────────────────────────────────
#>
#> ── Settings
#> nominal_sufix: _cat
#> numeric_sufix: _num
#>
#>
#> ── Datasets
#> # The combined dataset: 7 x 3
#> # A tibble: 3 × 2
#> dataset row_count
#> <chr> <int>
#> 1 full 3
#> 2 holdout 2
#> 3 original 2
#>
#> ── Exploratory Data Analysis
#> # A tibble: 3 × 4
#> variable type unique missing
#> <chr> <chr> <int> <int>
#> 1 id numeric 5 0
#> 2 p1 numeric 7 0
#> 3 p2 numeric 7 0