-
Notifications
You must be signed in to change notification settings - Fork 114
/
remove_row_type.Rd
42 lines (39 loc) · 1.17 KB
/
remove_row_type.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/remove_row_type.R
\name{remove_row_type}
\alias{remove_row_type}
\title{Remove rows}
\usage{
remove_row_type(
x,
variables = everything(),
type = c("header", "reference", "missing", "level", "all"),
level_value = NULL
)
}
\arguments{
\item{x}{(\code{gtsummary})\cr
A gtsummary object}
\item{variables}{(\code{\link[dplyr:dplyr_tidy_select]{tidy-select}})\cr
Variables to to remove rows from. Default is \code{everything()}}
\item{type}{(\code{string})\cr
Type of row to remove. Must be one of \code{c("header", "reference", "missing", "level", "all")}}
\item{level_value}{(\code{string})
When \code{type='level'} you can specify the \emph{character} value of the level to remove.
When \code{NULL} all levels are removed.}
}
\value{
Modified gtsummary table
}
\description{
Removes either the header, reference, or missing rows from a gtsummary table.
}
\examples{
# Example 1 ----------------------------------
trial |>
dplyr::mutate(
age60 = ifelse(age < 60, "<60", "60+")
) |>
tbl_summary(by = trt, missing = "no", include = c(trt, age, age60)) |>
remove_row_type(age60, type = "header")
}