Skip to content

Commit

Permalink
pre-release tm_g_distribution document update (#669)
Browse files Browse the repository at this point in the history
part of
#624

---------

Signed-off-by: kartikeya kirar <kirar.kartikeya1@gmail.com>
Co-authored-by: Vedha Viyash <49812166+vedhav@users.noreply.github.com>
  • Loading branch information
kartikeyakirar and vedhav authored Feb 27, 2024
1 parent b3ed9fa commit 446ce56
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 34 deletions.
34 changes: 17 additions & 17 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
#' Distribution Module
#' @md
#' Distribution analysis module
#'
#' @details
#' Module to analyze and explore univariate variable distribution
#' Module is designed to explore the distribution of a single variable within a given dataset.
#' It offers several tools, such as histograms, Q-Q plots, and various statistical tests to
#' visually and statistically analyze the variable's distribution.
#'
#' @inheritParams teal::module
#' @inheritParams teal.widgets::standard_layout
#' @inheritParams shared_params
#'
#' @param dist_var (`data_extract_spec` or `list` of multiple `data_extract_spec`)
#' Variable to consider for the distribution analysis.
#' Variable(s) for which the distribution will be analyzed.
#' @param strata_var (`data_extract_spec` or `list` of multiple `data_extract_spec`)
#' Categorical variable to split the selected distribution variable on.
#' @param group_var optional, (`data_extract_spec` or `list` of multiple `data_extract_spec`)
#' Which data columns to use for faceting rows.
#' @param freq optional, (`logical`) Whether to display frequency (`TRUE`) or density (`FALSE`).
#' Defaults to density (`FALSE`).
#' @param bins optional, (`integer(1)` or `integer(3)`) If scalar then the histogram bins will have a fixed size.
#' If a slider should be presented to adjust the number of histogram bins dynamically then it can be a
#' vector of length three with `c(value, min, max)`.
#' Defaults to `c(30L, 1L, 100L)`.
#' Categorical variable used to split the distribution analysis.
#' @param group_var (`data_extract_spec` or `list` of multiple `data_extract_spec`)
#' Variable used for faceting plot into multiple panels.
#' @param freq (`logical`, optional) Whether to display frequency (`TRUE`) or density (`FALSE`).
#' Defaults to density (`FALSE`).
#' @param bins (`integer(1)` or `integer(3)`, optional) Determines the number of bins for the histogram.
#' - When the length of `bins` is one: The histogram bins will have a fixed size based on the `bins` provided.
#' - When the length of `bins` is three: The histogram bins are dynamically adjusted based on vector of `value`, `min`, and `max`.

Check warning on line 21 in R/tm_g_distribution.R

View workflow job for this annotation

GitHub Actions / SuperLinter 🦸‍♀️ / Lint R code 🧶

file=R/tm_g_distribution.R,line=21,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 130 characters.
#' Defaults to `c(30L, 1L, 100L)`.
#'
#' @templateVar ggnames "Histogram", "QQplot"
#' @template ggplot2_args_multi
#'
#' @examples
#' # general data example
#' library(teal.widgets)
#'
#' # general data example
#' data <- teal_data()
#' data <- within(data, {
#' iris <- iris
Expand All @@ -53,8 +53,6 @@
#' }
#'
#' # CDISC data example
#' library(teal.widgets)
#'
#' data <- teal_data()
#' data <- within(data, {
#' ADSL <- rADSL
Expand Down Expand Up @@ -172,6 +170,7 @@ tm_g_distribution <- function(label = "Distribution Module",
)
}

# UI function for the distribution module
ui_distribution <- function(id, ...) {
args <- list(...)
ns <- NS(id)
Expand Down Expand Up @@ -317,6 +316,7 @@ ui_distribution <- function(id, ...) {
)
}

# Server function for the distribution module
srv_distribution <- function(id,
data,
reporter,
Expand Down
33 changes: 16 additions & 17 deletions man/tm_g_distribution.Rd

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

0 comments on commit 446ce56

Please sign in to comment.