reveal_maps: Reveal the level maps held inside a recipe

View source: R/recipe_print.R

reveal_mapsR Documentation

Reveal the level maps held inside a recipe

Description

Explicit, audited reveal: prints each original -> synthetic level map held by the recipe. Use sparingly. Recipe maps are at least as sensitive as the original data; printing them defeats the redaction built into the print(), format(), str() and knitr::knit_print() methods of recipes, recipe bundles, masque and masque_set objects. saveRDS() and dput() write the maps by design.

Usage

reveal_maps(rec, table = NULL)

Arguments

rec

A masque_recipe object (e.g., from recipe(m)), or the masque_recipe_set bundle of a mask_set() result.

table

For a bundle, the names of the tables whose maps to reveal. NULL (default) reveals every table. Must be NULL for a single recipe.

Details

For each recipe it prints the column-name map (when names were aliased), every level map as original -> alias, and the seed. The alias labels follow the scheme described under alias in mask(): trt_NNN or ⁠<col>_trt_NNN⁠ for treatments, ⁠<col>_LNNN⁠, ⁠<col>_DNNN⁠, ⁠<col>_INNN⁠ and ⁠<col>_TNNN⁠ for covariates, design columns, ids and text, and ⁠<col>_KNNN⁠ for a key shared across the tables of a set.

Value

rec, invisibly.

Examples

r <- propose_roles(iris)
r$role[r$col == "Sepal.Length"] <- "outcome"
r$role[r$col == "Species"] <- "covariate"
m <- mask(iris, r, mode = "collaborate", seed = 1)
rec <- recipe(m)
reveal_maps(rec)

masque documentation built on Nov. 19, 2026, 1:06 a.m.