Table masking using cell counts.
Details
Masking is used to prevent the distribution of tables where individuals could be identified.
Examples
library(dplyr)
example_data <- data.frame(Year = sample(2020:2023, 50, replace = TRUE),
A = sample(c("Type 1", "Type 2"), 50, replace = TRUE),
B = sample(c("Apples", "Oranges", "Bananas"), 50, replace = TRUE),
C = sample(c("Swedish", "Norwegian", "Chilean"), 50, replace = TRUE))
# With masking limit set at 7:
example_data |> select(Year, A) |>
ftable(exclude=NULL) |>
data.frame() |>
ivo_table_add_mask(cell = 7)
#> Year A Freq
#> 1 2020 Type 1 9
#> 2 2021 Type 1 1-7
#> 3 2022 Type 1 1-7
#> 4 2023 Type 1 1-7
#> 5 2020 Type 2 1-7
#> 6 2021 Type 2 1-7
#> 7 2022 Type 2 1-7
#> 8 2023 Type 2 1-7