subjectProfileSummaryTable: Plot a table with 'ggplot' of a text variable of interest.

subjectProfileSummaryTableR Documentation

Plot a table with ggplot of a text variable of interest.

Description

The labels extracted based on the text parameter and displayed at the x-position based on xVar and the y-position based on colorVar. Each group specified in the color variables are displayed in different lines in the plot.

Usage

subjectProfileSummaryTable(
  data,
  xVar,
  text,
  xLim = NULL,
  colorVar = NULL,
  colorPalette = NULL,
  colorLab = getLabelVar(colorVar, labelVars = labelVars),
  fontface = 1,
  xLab = NULL,
  labelVars = NULL,
  caption = NULL,
  showLegend = TRUE,
  legendPosition = ifelse(showLegend, "right", "none"),
  yAxisLabs = FALSE,
  xAxisLabs = NULL,
  style = "report",
  fontname = switch(style, report = "Times", presentation = "Tahoma"),
  fontsize = switch(style, report = 8, presentation = 10),
  pointSize = 1.5,
  themeFct = switch(style, report = theme_classic, presentation = theme_bw),
  textSize = fontsize/ggplot2::.pt,
  xTrans = NULL
)

Arguments

data

Data.frame (in long format) with data for the table.

xVar

String, variable of data with variable for the x-axis.

text

Character vector with colnames of data or expression based on colnames of data to extract the text label.

xLim

Vector of the length 2 with limits for the x-axis.

colorVar

String, variable of data for coloring.

colorPalette

(named) Vector with color palette.

colorLab

String, label for colorVar, used in the legend.

fontface

Numeric, fontface for the text.

xLab

String with label for the x-axis.

labelVars

Named string with variable labels (names are the variable code).

caption

String with caption for the plot, NULL by default.

showLegend

Logical, should the legend be displayed? TRUE by default.

legendPosition

String with legendPosition, 'right' by default.

yAxisLabs

Logical, if TRUE include the labels in the y-axis.

xAxisLabs

Vector with labels for the x-axis if xVar is discrete or vector with limits if continuous.

style

String with subject profile style. This affects the parameters: fontname, fontsize and themeFct.

fontname

String with font name, by default 'Times' if style is 'report' and 'Tahoma' if style is 'presentation'.

fontsize

Numeric vector of length 1 with font size, by default 8 if style is 'report' and 10 if style is 'presentation'

pointSize

Numeric indicating the size of points in the legend, 1.5 by default

themeFct

Function with ggplot2 theme, by default theme_classic if style is 'report' and theme_bw if style is 'presentation'.

textSize

Size for the text.

xTrans

(optional) ggplot2 transformation for the x-axis.

Value

ggplot object

Author(s)

Laure Cougnaud and Michela Pasetto


inTextSummaryTable documentation built on Sept. 12, 2023, 5:06 p.m.