plot_api_g {lgpr}R Documentation

Plot longitudinal data and/or model fit so that each subject/group has their own panel

Description

Data frames specified in arguments df_data, df_signal, df_fit, and df_fit_err must have a format where

Usage

plot_api_g(
  df_data,
  df_signal = NULL,
  df = NULL,
  df_err = NULL,
  teff_signal = NULL,
  teff_obs = NULL,
  i_test = NULL,
  color_signal = color_palette(2)[1],
  color = color_palette(2)[2],
  color_err = colorset("red", "light_highlight"),
  color_vlines = colorset("gray", "mid_highlight"),
  alpha = 1,
  alpha_err = 0.5,
  nrow = NULL,
  ncol = NULL,
  y_transform = function(x) x
)

Arguments

df_data

A data frame containing the observations.

df_signal

A data frame containing the true signal. Omitted if NULL.

df

A data frame containing the model fit, or a list of data frames. The list version can be used for example so that each list element corresponds to the fit computed using one parameter draw. Omitted if NULL.

df_err

A data frame containing error bars. Omitted if NULL. Must be NULL if df_fit is a list.

teff_signal

A named vector containing true effect times used to generate the signal. Omitted if NULL.

teff_obs

A named vector containing observed effect times. Omitted if NULL.

i_test

Indices of test points.

color_signal

Line color for true signal.

color

Line color for model fit.

color_err

Color of the error ribbon.

color_vlines

Two line colors for vertical lines (true and obs. effect time).

alpha

Line opacity for model fit.

alpha_err

Opacity of the error ribbon.

nrow

number of rows, an argument for facet_wrap

ncol

number of columns, an argument for facet_wrap

y_transform

A function to be applied to the third column of df_data.

Value

A ggplot object.

See Also

Other internal plot API functions: plot_api_c()


[Package lgpr version 1.2.4 Index]