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
the first column is the grouping factor (usually id)
the second column is the x-axis variable (usually age)
a column named
y
must contain the y-axis variable (not fordf_fit_err
)a column named
lower
(upper
) must contain the lower (upper) bound of error bar (only fordf_fit_err
)a column named
draw
must be a factor that specifies the posterior draw using which the fit has been computed (only fordf_fit
)
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
|
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
|
df_err |
A data frame containing error bars. Omitted if |
teff_signal |
A named vector containing true effect times used to
generate the signal. Omitted if |
teff_obs |
A named vector containing observed effect times. Omitted if
|
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
|
ncol |
number of columns, an argument for
|
y_transform |
A function to be applied to the third column of
|
Value
A ggplot
object.
See Also
Other internal plot API functions:
plot_api_c()