I am creating multiple weighted tables with multiple variables, and I'm curious about whether weighted values can be changed based on **unweighted** values. Specifically, when n<2, replace cell by NA.

Example data:

```
df <- data.frame(a= c("m","f","f","m", "m", "f", "f"),b= c("g1","g2","g1","g2", "g2", "g2", "g2"),
                 weight = c(1.1, 0.8, 2.2, 4, 3, 0.3, 1.9))

> df
  a  b weight
1 m g1    1.1
2 f g2    0.8
3 f g1    2.2
4 m g2    4.0
5 m g2    3.0
6 f g2    0.3
7 f g2    1.9

```

Table:

```
library(gtsummary)
library(srvyr)

tbl_summary_object <- df %>%
  as_survey_design(1, weight = weight) %>%
  gtsummary::tbl_svysummary(
    missing="no",
    by=a,
    include=-weight,
    label=list(
      b ~ "group"
    ),
    percent="row"
  )

```

[![enter image description here](https://i.stack.imgur.com/V7cVg.png)](https://i.stack.imgur.com/V7cVg.png)

I am looking to modify cells based on **unweighted** cells:

```
> table(df$a, df$b)

    g1 g2
  f  1  3
  m  1  2

```

I know that the "by" unweighted variable can be accessed `tbl_summary_object$df_by`. However, I am looking to change each cell based on n<2 in **unweighted** data. Any pointers would be greatly appreciated.