Learn R Programming

gtsummary (version 1.2.0)

sort_p.tbl_summary: Sort variables in table by ascending p-values

Description

Sort variables in tables created by tbl_summary by ascending p-values

Usage

# S3 method for tbl_summary
sort_p(x, q = FALSE, ...)

Arguments

x

An object created using tbl_summary function

q

Logical argument. When TRUE will sort by the q-value column rather than the p-values

...

Not used

Value

A tbl_summary object

Example Output

See Also

Other tbl_summary tools: add_n, add_overall, add_p, add_q.tbl_summary, add_stat_label, bold_italicize_labels_levels, bold_p.tbl_summary, inline_text.tbl_summary, modify_header, tbl_summary

Examples

Run this code
# NOT RUN {
tbl_sum_sort_p_ex <-
  trial %>%
  dplyr::select(age, grade, response, trt) %>%
  tbl_summary(by = trt) %>%
  add_p() %>%
  sort_p()
# }

Run the code above in your browser using DataLab