This function generates a ggplot2 visualization of observations and their transformations within a pharmacometric model. The plot superimposes the observed query and reference data from original to vachette transformed values, showing direction of transformation. Reference and query curves are additionally overlaid for comparison.

p.vachette.arrow(vachette_data)

Arguments

vachette_data

An object of class vachette_data, which contains the necessary data for plotting.

Value

A ggplot2 object representing the observations, their transformations, and the corresponding reference and query curves. The plot also indicates if any extrapolated reference curves are present and how many observations were excluded from the transformation.

Details

The function plots the original and vachette transformed observations, with arrows showing the transformation path. Reference and query curves are also plotted, with extrapolated reference curves displayed as dashed lines if available. The subtitle provides information about the error model used (additive or proportional) and the number of excluded observations.

The plot's title includes the model name, and the caption provides details about the reference covariate(s) used. The x-axis range is dynamically set based on the scaled x values. If the x-axis is logarithmic, the axis label is adjusted accordingly.