Learn R Programming

teal.modules.clinical (version 0.9.0)

template_g_lineplot: Template: Line Plot

Description

Creates a valid expression to generate a ggplot2::ggplot() line plot.

Usage

template_g_lineplot(
  dataname = "ANL",
  strata = "ARM",
  x = "AVISIT",
  y = "AVAL",
  y_unit = "AVALU",
  paramcd = "PARAMCD",
  param = "ALT",
  mid = "mean",
  interval = "mean_ci",
  whiskers = c("mean_ci_lwr", "mean_ci_upr"),
  table = c("n", "mean_sd", "median", "range"),
  mid_type = "pl",
  conf_level = 0.95,
  incl_screen = TRUE,
  mid_point_size = 2,
  table_font_size = 4,
  title = "Line Plot",
  y_lab = "",
  ggplot2_args = teal.widgets::ggplot2_args()
)

Value

a list of expressions to generate a table or plot object.

Arguments

dataname

(character)
analysis data used in teal module.

strata

(character or NA)
deprecated - group variable name.

x

(character)
x variable name.

y

(character)
y variable name.

y_unit

(character or NA)
y_unit variable name.

paramcd

(character or NA)
paramcd variable name.

param

(character)
parameter to filter the data by.

mid

(character or NULL)
names of the statistics that will be plotted as midpoints. All the statistics indicated in mid variable must be present in the object returned by sfun, and be of a double or numeric type vector of length one.

interval

(character or NULL)
names of the statistics that will be plotted as intervals. All the statistics indicated in interval variable must be present in the object returned by sfun, and be of a double or numeric type vector of length two. Set interval = NULL if intervals should not be added to the plot.

whiskers

(character)
names of the interval whiskers that will be plotted. Names must match names of the list element interval that will be returned by sfun (e.g. mean_ci_lwr element of sfun(x)[["mean_ci"]]). It is possible to specify one whisker only, or to suppress all whiskers by setting interval = NULL.

table

(character or NULL)
names of the statistics that will be displayed in the table below the plot. All the statistics indicated in table variable must be present in the object returned by sfun.

mid_type

(character)
controls the type of the mid plot, it can be point (p), line (l), or point and line (pl).

conf_level

(numeric)
value for the confidence level within the range of (0, 1).

incl_screen

(logical)
whether the screening visit should be included.

mid_point_size

(integer or double)
controls the font size of the point for mid plot.

table_font_size

(integer or double)
controls the font size of values in the table.

title

(character)
plot title.

y_lab

(character)
y-axis label. If equal to NULL, then no label will be added.

ggplot2_args

optional, (ggplot2_args)
object created by teal.widgets::ggplot2_args() with settings for the module plot. For this module, this argument will only accept ggplot2_args object with labs list of following child elements: title, subtitle, caption, y, lty. No other elements would be taken into account. The argument is merged with option teal.ggplot2_args and with default module arguments (hard coded in the module body).

For more details, see the vignette: vignette("custom-ggplot2-arguments", package = "teal.widgets").

See Also

tm_g_lineplot()