Skip to content

Commit

Permalink
pre-release tm_g_association document update (#656)
Browse files Browse the repository at this point in the history
part of
#624
  • Loading branch information
kartikeyakirar authored Feb 27, 2024
1 parent 672b217 commit b3ed9fa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
33 changes: 19 additions & 14 deletions R/tm_g_association.R
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
#' Stack Plots of variables and show association with reference variable
#' @md
#' Stack plots of variables and show association with reference variable
#'
#' Module provides functionality for visualizing the distribution of variables and
#' their association with a reference variable.
#' It supports configuring the appearance of the plots, including themes and whether to show associations.
#'
#'
#' @note For more examples, please see the vignette "Using association plot" via
#' `vignette("using-association-plot", package = "teal.modules.general")`.
#'
#' @inheritParams teal::module
#' @inheritParams shared_params
#' @param ref (`data_extract_spec` or `list` of multiple `data_extract_spec`)
#' reference variable, must set `multiple = FALSE`.
#' Reference variable, must accepts a `data_extract_spec` with `select_spec(multiple = FALSE)`
#' to ensure single selection option.
#' @param vars (`data_extract_spec` or `list` of multiple `data_extract_spec`)
#' associated variables.
#' @param show_association optional, (`logical`) Whether show association of `vars`
#' with reference variable. Defaults to `TRUE`.
#' @param distribution_theme,association_theme optional, (`character`) `ggplot2` themes to be used by default.
#' Default to `"gray"`.
#' Variables to be associated with the reference variable.
#' @param show_association (`logical`) optional whether show association of `vars`
#' with reference variable. Defaults to `TRUE`.
#' @param distribution_theme,association_theme (`character`) optional `ggplot2` themes to be used by default.
#' Default to `"gray"`.
#'
#' @templateVar ggnames "Bivariate1", "Bivariate2"
#' @template ggplot2_args_multi
#'
#' @note For more examples, please see the vignette "Using association plot" via
#' \code{vignette("using-association-plot", package = "teal.modules.general")}.
#'
#' @examples
#' # general data exapmle
#' library(teal.widgets)
#'
#' # general data example
#' data <- teal_data()
#' data <- within(data, {
#' require(nestcolor)
Expand Down Expand Up @@ -65,8 +70,6 @@
#' }
#'
#' # CDISC data example
#' library(teal.widgets)
#'
#' data <- teal_data()
#' data <- within(data, {
#' require(nestcolor)
Expand Down Expand Up @@ -172,6 +175,7 @@ tm_g_association <- function(label = "Association",
)
}

# UI function for the association module
ui_tm_g_association <- function(id, ...) {
ns <- NS(id)
args <- list(...)
Expand Down Expand Up @@ -249,6 +253,7 @@ ui_tm_g_association <- function(id, ...) {
)
}

# Server function for the association module
srv_tm_g_association <- function(id,
data,
reporter,
Expand Down
19 changes: 10 additions & 9 deletions man/tm_g_association.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b3ed9fa

Please sign in to comment.