小编Rob*_*ogi的帖子

想要将数字(小数)仅放入 tbl_summary 中单独的百分比列值。有关于地图如何工作的详细教程吗?

我只想为百分比列添加小数

#分离列库(gtsummary) 库(tidyverse)

tbl <- 
  c("{n}", "{p}%") %>%         # iterate over these two statistics
  # build tbl_summary using each of the stats
  map(
    ~trial %>% 
      select(response, grade) %>% 
      tbl_summary(
        statistic = all_categorical() ~ .x,
        missing = "ifany",
    digits = list(
      all_categorical() ~ 1,
      all_continuous() ~ 0
    ),
    missing_text = "(Missing)"
      ) 
  ) %>%
  # merge the two tables together
   tbl_merge() %>%
  # some formatting to make it cute
  modify_spanning_header(everything() ~ NA) %>%
  modify_footnote(everything() ~ NA) %>%
  modify_header(list(stat_0_1 ~ "**n / …
Run Code Online (Sandbox Code Playgroud)

r gtsummary

4
推荐指数
1
解决办法
642
查看次数

标签 统计

gtsummary ×1

r ×1