Skip to content

Commit 64f247c

Browse files
edelaruaMelkiades
andauthored
Clean up documentation for tm_g_ipp (#1034)
# Pull Request <!--- Replace `#nnn` with your issue link for reference. --> Fixes #945 --------- Co-authored-by: Davide Garolini <davide.garolini@roche.com>
1 parent 66e4c5c commit 64f247c

File tree

5 files changed

+80
-70
lines changed

5 files changed

+80
-70
lines changed

R/argument_convention.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#' @param avalu `r lifecycle::badge("deprecated")` Please use the `avalu_var` argument instead.
1818
#' @param avalu_var (`character`)\cr name of the analysis value unit variable.
1919
#' @param aval_var (`character`)\cr name of the analysis value variable.
20+
#' @param baseline_var (`character`)\cr name of the variable for baseline values of the analysis variable.
2021
#' @param base_var `r lifecycle::badge("deprecated")` Please use the `baseline_var` argument instead.
2122
#' @param basic_table_args optional, (`basic_table_args`)\cr object created by [teal.widgets::basic_table_args()]
2223
#' with settings for the module table. The argument is merged with option `teal.basic_table_args` and with default

R/tm_g_ipp.R

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
#' Template: Individual Patient Plots
22
#'
3+
#' Creates a valid expression to generate [ggplot2::ggplot()] plots of individual patients.
4+
#'
35
#' @inheritParams template_arguments
4-
#' @param avalu_var (`string`)\cr variable name designating the unit of the analysis variable.
5-
#' @param baseline_var (`string`)\cr variable name designating the baseline values of analysis variable.
6-
#' @param visit_var (`string`)\cr variable name designating the visit timepoint variable.
7-
#' @param add_baseline_hline (`flag`)\cr adds horizontal line at baseline y-value on plot
8-
#' @param separate_by_obs (`flag`)\cr creates multi panel plots when TRUE
9-
#' @param suppress_legend (`flag`)\cr allow user to suppress legend
10-
#' @param arm_levels (`character`)\cr vector of all arm variable levels.
11-
#' @param avalu_first (`string`)\cr `avalu` value.
12-
#' @param paramcd_first (`string`)\cr `paramcd` value.
13-
#' @param add_avalu (`flag`)\cr allow user to not display value unit in the plot.
14-
#' @param ggplot2_args optional, (`ggplot2_args`)\cr
15-
#' object created by [teal.widgets::ggplot2_args()] with settings for the module plot.
16-
#' For this module, this argument will only accept `ggplot2_args` object with `labs` list of following child elements:
17-
#' `title`, `subtitle`, `x`, `y`.
18-
#' No other elements would be taken into account. The argument is merged with option `teal.ggplot2_args` and
19-
#' with default module arguments (hard coded in the module body).
6+
#' @param visit_var (`character`)\cr name of the variable for visit timepoints.
7+
#' @param add_baseline_hline (`logical`)\cr whether a horizontal line should be added to the plot at baseline y-value.
8+
#' @param separate_by_obs (`logical`)\cr whether to create multi-panel plots.
9+
#' @param suppress_legend (`logical`)\cr whether to suppress the plot legend.
10+
#' @param arm_levels (`character`)\cr vector of all levels of `arm_var`.
11+
#' @param avalu_first (`character`)\cr `avalu_var` text to append to the plot title and y-axis label if `add_avalu` is
12+
#' `TRUE`.
13+
#' @param paramcd_first (`character`)\cr `paramcd` text to append to the plot title and y-axis label.
14+
#' @param add_avalu (`logical`)\cr whether `avalu_first` text should be appended to the plot title and y-axis label.
15+
#' @param ggplot2_args optional, (`ggplot2_args`)\cr object created by [teal.widgets::ggplot2_args()] with settings
16+
#' for the module plot. For this module, this argument will only accept `ggplot2_args` object with `labs` list of
17+
#' the following child elements: `title`, `subtitle`, `x`, `y`. No other elements are taken into account. The
18+
#' argument is merged with option `teal.ggplot2_args` and with default module arguments (hard coded in the module
19+
#' body).
2020
#'
21-
#' For more details, see the vignette: `vignette("custom-ggplot2-arguments", package = "teal.widgets")`.
22-
#' @keywords internal
21+
#' For more details, see the vignette: `vignette("custom-ggplot2-arguments", package = "teal.widgets")`.
22+
#'
23+
#' @inherit template_arguments return
2324
#'
25+
#' @seealso [tm_g_ipp()]
26+
#'
27+
#' @keywords internal
2428
template_g_ipp <- function(dataname = "ANL",
2529
paramcd,
2630
arm_var,
@@ -93,8 +97,6 @@ template_g_ipp <- function(dataname = "ANL",
9397
)
9498
)
9599

96-
97-
98100
graph_list <- list()
99101
graph_list <- add_expr(
100102
graph_list,
@@ -167,27 +169,20 @@ template_g_ipp <- function(dataname = "ANL",
167169
y
168170
}
169171

170-
#' Teal Module: Individual Patient Plot
172+
#' teal Module: Individual Patient Plots
171173
#'
172-
#' This teal module produces grid style Individual patient plot(s) that show
173-
#' trends in parameter values over time for each patient using data with
174-
#' `ADaM` structure.
174+
#' This module produces [ggplot2::ggplot()] type individual patient plots that display trends in parameter
175+
#' values over time for each patient, using data with ADaM structure.
175176
#'
176177
#' @inheritParams module_arguments
177178
#' @inheritParams template_g_ipp
178-
#' @param arm_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr
179-
#' object with all available choices
180-
#' and preselected option for variable values that can be used as `arm_var`.
181-
#' @param ggplot2_args optional, (`ggplot2_args`)\cr
182-
#' object created by [teal.widgets::ggplot2_args()] with settings for the module plot.
183-
#' For this module, this argument will only accept `ggplot2_args` object with `labs` list of following child elements:
184-
#' `title`, `subtitle`, `x`, `y`.
185-
#' No other elements would be taken into account. The argument is merged with option `teal.ggplot2_args` and
186-
#' with default module arguments (hard coded in the module body).
179+
#' @param arm_var ([teal.transform::choices_selected()] or [teal.transform::data_extract_spec()])\cr object with
180+
#' all available choices and preselected option for variable values that can be used as arm variable.
187181
#'
188-
#' For more details, see the vignette: `vignette("custom-ggplot2-arguments", package = "teal.widgets")`.
182+
#' @inherit module_arguments return
189183
#'
190-
#' @export
184+
#' @seealso The [TLG Catalog](https://insightsengineering.github.io/tlg-catalog/stable/) where additional example
185+
#' apps implementing this module can be found.
191186
#'
192187
#' @examples
193188
#' library(nestcolor)
@@ -254,6 +249,7 @@ template_g_ipp <- function(dataname = "ANL",
254249
#' shinyApp(ui = app$ui, server = app$server)
255250
#' }
256251
#'
252+
#' @export
257253
tm_g_ipp <- function(label,
258254
dataname,
259255
parentname = ifelse(
@@ -358,7 +354,7 @@ tm_g_ipp <- function(label,
358354
)
359355
}
360356

361-
357+
#' @keywords internal
362358
ui_g_ipp <- function(id, ...) {
363359
a <- list(...) # module args
364360
is_single_dataset_value <- teal.transform::is_single_dataset(
@@ -460,6 +456,7 @@ ui_g_ipp <- function(id, ...) {
460456
)
461457
}
462458

459+
#' @keywords internal
463460
srv_g_ipp <- function(id,
464461
data,
465462
reporter,

man/template_arguments.Rd

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

man/template_g_ipp.Rd

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

man/tm_g_ipp.Rd

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

0 commit comments

Comments
 (0)