Returns a tidy summary of each variable's structure, missingness, uniqueness, and suitability for use in regression models.
Usage
dissect(data, verbose = FALSE, format = c("flextable", "gt", "tibble"))Value
A tibble, gt_tbl, or flextable, depending on
format. The tibble has columns: Variable, Type, Missing (
Levels, Compatibility, and Hint.
Examples
dissect(data_birthwt, format = "tibble")
#> # A tibble: 10 × 7
#> Variable Type `Missing (%)` Unique Levels Compatibility Hint
#> <chr> <chr> <chr> <int> <chr> <chr> <chr>
#> 1 low integer 0% 2 - maybe Two numeric value…
#> 2 age integer 0% 24 - compatible Numeric variable …
#> 3 lwt integer 0% 75 - compatible Numeric variable …
#> 4 race integer 0% 3 - compatible Numeric variable …
#> 5 smoke integer 0% 2 - maybe Two numeric value…
#> 6 ptl integer 0% 4 - compatible Numeric variable …
#> 7 ht integer 0% 2 - maybe Two numeric value…
#> 8 ui integer 0% 2 - maybe Two numeric value…
#> 9 ftv integer 0% 6 - compatible Numeric variable …
#> 10 bwt integer 0% 131 - compatible Numeric variable …
dissect(data_birthwt, format = "gt")
Dataset dissection before regression
Screening aid only; review coding, missingness, sparse levels, and study context before modeling.
# Print notes that help interpret the data structure
dissect(data_birthwt, verbose = TRUE, format = "tibble")
#> # A tibble: 10 × 7
#> Variable Type `Missing (%)` Unique Levels Compatibility Hint
#> <chr> <chr> <chr> <int> <chr> <chr> <chr>
#> 1 low integer 0% 2 - maybe Two numeric value…
#> 2 age integer 0% 24 - compatible Numeric variable …
#> 3 lwt integer 0% 75 - compatible Numeric variable …
#> 4 race integer 0% 3 - compatible Numeric variable …
#> 5 smoke integer 0% 2 - maybe Two numeric value…
#> 6 ptl integer 0% 4 - compatible Numeric variable …
#> 7 ht integer 0% 2 - maybe Two numeric value…
#> 8 ui integer 0% 2 - maybe Two numeric value…
#> 9 ftv integer 0% 6 - compatible Numeric variable …
#> 10 bwt integer 0% 131 - compatible Numeric variable …
#>
#> Interpretation notes:
#> - compatible: ready to use in regression or with minimal preparation
#> - maybe: check coding, sparse levels, or whether transformation is needed
#> - incompatible: not usable as-is (e.g., all NA or no variation)
#> # A tibble: 10 × 7
#> Variable Type `Missing (%)` Unique Levels Compatibility Hint
#> <chr> <chr> <chr> <int> <chr> <chr> <chr>
#> 1 low integer 0% 2 - maybe Two numeric value…
#> 2 age integer 0% 24 - compatible Numeric variable …
#> 3 lwt integer 0% 75 - compatible Numeric variable …
#> 4 race integer 0% 3 - compatible Numeric variable …
#> 5 smoke integer 0% 2 - maybe Two numeric value…
#> 6 ptl integer 0% 4 - compatible Numeric variable …
#> 7 ht integer 0% 2 - maybe Two numeric value…
#> 8 ui integer 0% 2 - maybe Two numeric value…
#> 9 ftv integer 0% 6 - compatible Numeric variable …
#> 10 bwt integer 0% 131 - compatible Numeric variable …