Skip to content

Commit b3ed9fa

Browse files
pre-release tm_g_association document update (#656)
part of #624
1 parent 672b217 commit b3ed9fa

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

R/tm_g_association.R

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
#' Stack Plots of variables and show association with reference variable
2-
#' @md
1+
#' Stack plots of variables and show association with reference variable
2+
#'
3+
#' Module provides functionality for visualizing the distribution of variables and
4+
#' their association with a reference variable.
5+
#' It supports configuring the appearance of the plots, including themes and whether to show associations.
6+
#'
7+
#'
8+
#' @note For more examples, please see the vignette "Using association plot" via
9+
#' `vignette("using-association-plot", package = "teal.modules.general")`.
310
#'
411
#' @inheritParams teal::module
512
#' @inheritParams shared_params
613
#' @param ref (`data_extract_spec` or `list` of multiple `data_extract_spec`)
7-
#' reference variable, must set `multiple = FALSE`.
14+
#' Reference variable, must accepts a `data_extract_spec` with `select_spec(multiple = FALSE)`
15+
#' to ensure single selection option.
816
#' @param vars (`data_extract_spec` or `list` of multiple `data_extract_spec`)
9-
#' associated variables.
10-
#' @param show_association optional, (`logical`) Whether show association of `vars`
11-
#' with reference variable. Defaults to `TRUE`.
12-
#' @param distribution_theme,association_theme optional, (`character`) `ggplot2` themes to be used by default.
13-
#' Default to `"gray"`.
17+
#' Variables to be associated with the reference variable.
18+
#' @param show_association (`logical`) optional whether show association of `vars`
19+
#' with reference variable. Defaults to `TRUE`.
20+
#' @param distribution_theme,association_theme (`character`) optional `ggplot2` themes to be used by default.
21+
#' Default to `"gray"`.
1422
#'
1523
#' @templateVar ggnames "Bivariate1", "Bivariate2"
1624
#' @template ggplot2_args_multi
1725
#'
18-
#' @note For more examples, please see the vignette "Using association plot" via
19-
#' \code{vignette("using-association-plot", package = "teal.modules.general")}.
20-
#'
2126
#' @examples
22-
#' # general data exapmle
2327
#' library(teal.widgets)
2428
#'
29+
#' # general data example
2530
#' data <- teal_data()
2631
#' data <- within(data, {
2732
#' require(nestcolor)
@@ -65,8 +70,6 @@
6570
#' }
6671
#'
6772
#' # CDISC data example
68-
#' library(teal.widgets)
69-
#'
7073
#' data <- teal_data()
7174
#' data <- within(data, {
7275
#' require(nestcolor)
@@ -172,6 +175,7 @@ tm_g_association <- function(label = "Association",
172175
)
173176
}
174177

178+
# UI function for the association module
175179
ui_tm_g_association <- function(id, ...) {
176180
ns <- NS(id)
177181
args <- list(...)
@@ -249,6 +253,7 @@ ui_tm_g_association <- function(id, ...) {
249253
)
250254
}
251255

256+
# Server function for the association module
252257
srv_tm_g_association <- function(id,
253258
data,
254259
reporter,

man/tm_g_association.Rd

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)