plot_factors: Various plots for factor prediction and derivation

View source: R/plot_factors.R

plot_factorsR Documentation

Various plots for factor prediction and derivation

Description

plot_factors plots various aspects of the transdiagnostic factor derivation, including histograms and heatmaps of the questions themselves.

Usage

plot_factors(
  df,
  plot_type,
  colnames = NA,
  titles = NA,
  r2 = NA,
  qn = NA,
  hyp_alph = 0.1,
  grouped = FALSE,
  pal = NULL,
  font = "",
  font_size = 11
)

Arguments

df

Data frame with factor scores or questions to plot. For predictive and factor_htmp plots, this should be a named list of data.frames (including "preds" & "scores" or "qns" & "coefs" respectively). If a factor_hist plot with grouped = TRUE is desired, it should be a list of data.frames (one per group).

plot_type

Plot(s) to output: factor_hist (which can be grouped), r2_plot,predictive, and factor_htmp.

colnames

Column names to get data from.

titles

Title(s) for the plot(s) or pretty names more generally.

r2

Array of R^{2} values.

qn

Number of questions - used to find correct R^{2} values.

hyp_alph

Chosen alpha value (used to draw a dotted line on an r2_plot).

grouped

.

pal, font, font_size

Same as plot_import.

Value

A single or list of ggplot object(s).

Examples

# See the notebook (data_cleaning_factor_derivation.ipynb) for examples as
# it requires Python input.

qdercon/pstpipeline documentation built on June 1, 2025, 1:11 p.m.