-
Notifications
You must be signed in to change notification settings - Fork 114
/
select_helpers.Rd
83 lines (71 loc) · 2.7 KB
/
select_helpers.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/select_helpers.R
\name{select_helpers}
\alias{select_helpers}
\alias{all_continuous}
\alias{all_continuous2}
\alias{all_categorical}
\alias{all_dichotomous}
\alias{all_tests}
\alias{all_intercepts}
\alias{all_interaction}
\alias{all_contrasts}
\alias{all_stat_cols}
\title{Select helper functions}
\usage{
all_continuous(continuous2 = TRUE)
all_continuous2()
all_categorical(dichotomous = TRUE)
all_dichotomous()
all_tests(tests)
all_intercepts()
all_interaction()
all_contrasts(
contrasts_type = c("treatment", "sum", "poly", "helmert", "sdif", "other")
)
all_stat_cols(stat_0 = TRUE)
}
\arguments{
\item{continuous2}{(scalar \code{logical})\cr
Logical indicating whether to include continuous2 variables. Default is \code{TRUE}}
\item{dichotomous}{(scalar \code{logical})\cr
Logical indicating whether to include dichotomous variables. Default is \code{TRUE}}
\item{tests}{(\code{character})\cr
character vector indicating the test type of the variables to select, e.g.
select all variables being compared with \code{"t.test"}.}
\item{contrasts_type}{(\code{character})\cr
type of contrast to select. Select among contrast types \code{c("treatment", "sum", "poly", "helmert", "sdif", "other")}.
Default is all contrast types.}
\item{stat_0}{(scalar \code{logical})\cr
When \code{FALSE}, will not select the \code{"stat_0"} column. Default is \code{TRUE}}
}
\value{
A character vector of column names selected
}
\description{
Set of functions to supplement the \{tidyselect\} set of
functions for selecting columns of data frames (and other items as well).
\itemize{
\item \code{all_continuous()} selects continuous variables
\item \code{all_continuous2()} selects only type \code{"continuous2"}
\item \code{all_categorical()} selects categorical (including \code{"dichotomous"}) variables
\item \code{all_dichotomous()} selects only type \code{"dichotomous"}
\item \code{all_tests()} selects variables by the name of the test performed
\item \code{all_stat_cols()} selects columns from \code{tbl_summary}/\code{tbl_svysummary} object with summary statistics (i.e. \code{"stat_0"}, \code{"stat_1"}, \code{"stat_2"}, etc.)
\item \code{all_interaction()} selects interaction terms from a regression model
\item \code{all_intercepts()} selects intercept terms from a regression model
\item \code{all_contrasts()} selects variables in regression model based on their type of contrast
}
}
\examples{
select_ex1 <-
trial |>
select(age, response, grade) |>
tbl_summary(
statistic = all_continuous() ~ "{mean} ({sd})",
type = all_dichotomous() ~ "categorical"
)
}
\seealso{
Review \link[=syntax]{list, formula, and selector syntax} used throughout gtsummary
}