Learn R Programming

teal.modules.general (version 0.3.0)

plot_var_summary: Plot variable

Description

Creates summary plot with statistics relevant to data type.

Usage

plot_var_summary(
  var,
  var_lab,
  wrap_character = NULL,
  numeric_as_factor,
  display_density = is.numeric(var),
  remove_NA_hist = FALSE,
  outlier_definition,
  records_for_factor,
  ggplot2_args
)

Value

plot

Arguments

var

vector of any type to be plotted. For numeric variables it produces histogram with density line, for factors it creates frequency plot

var_lab

text describing selected variable to be displayed on the plot

wrap_character

(numeric) number of characters at which to wrap text values of var

numeric_as_factor

(logical) should the numeric variable be treated as a factor

display_density

(logical) should density estimation be displayed for numeric values

remove_NA_hist

(logical) should NA values be removed for histogram of factor like variables

outlier_definition

if 0 no outliers are removed, otherwise outliers (those more than outlier_definition*IQR below/above Q1/Q3 be removed)

records_for_factor

(numeric) if the number of factor levels is >= than this value then a graph of the factors isn't shown, only a list of values

ggplot2_args

(ggplot2_args) object created by teal.widgets::ggplot2_args() with settings for the module plot. The argument is merged with options variable teal.ggplot2_args and default module setup.

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