View source: R/trial_means_plot.R
trial_means_plot | R Documentation |
trial_means_plot
creates a graph comparing variability
across simulated trials and, when supplied, across observed trials as well
for a given PK parameter. The central statistic is shown as a dot and the
variability statistic is shown as error bars for each of the trials, and
you can choose which statistics you want for each, e.g., geometric means
for the central statistic and the geometric 90% confidence interval for
the variability statistic. UNDER CONSTRUCTION.
IMPORTANT: If the summary statistics used for your observed data
don't match the summary statistics you choose for mean_type
and
variability_type
, you will get a misleading graph, so be careful!
trial_means_plot(
sim_data_file,
PKparameter = "Cmax_dose1",
compoundToExtract = "substrate",
tissue = "plasma",
sheet = NA,
mean_type = "geometric",
variability_type = "percentiles",
observed_PK = NA,
lines_for_population_stats = "gray80 solid dotted",
color_set = "default",
color_option = "by study",
point_shape = NA,
point_size = NA,
bar_width = NA,
y_axis_limits_lin = NA,
legend_position = "right",
include_dose_num = FALSE,
graph_title = NA,
graph_title_size = 14,
existing_exp_details = NA,
return_caption = FALSE,
prettify_compound_names = TRUE,
clin_study_label_option = "observed or study number",
save_graph = NA,
fig_height = NA,
fig_width = NA
)
sim_data_file |
name of the Excel file containing the simulator output, in quotes |
PKparameter |
PK parameter you want to extract from the simulator output
file. To see the full set of possible parameters to extract, enter
|
compoundToExtract |
For which compound do you want to extract PK data? Options are:
|
tissue |
For which tissue would you like the PK parameters to be pulled? Options are "plasma" (default), "unbound plasma", "blood", "unbound blood", "peripheral plasma", or "peripheral blood". NOTE: PK for peripheral sampling is not as well tested as for other tissues and is only set up for V21+. Please check your results carefully. |
sheet |
optionally specify the name of the sheet where you'd like to pull the PK data, in quotes. For example, if you have a user-defined AUC interval, specify the tab where those data are. NOTE: If you want typical first- or last-dose PK, this should be left as NA. This only applies for user-defined AUC intervals. |
mean_type |
What kind of means do you want to use for the center point on the graph? Options are "geometric" (default), "arithmetic", or "median". |
variability_type |
What variability statistic to you want to use for the error bars? Options are "percentiles" for the 5th to 95th percentiles (default), "90% CI", "SD", "CV", "GCV" (for geometric CV), or "range". |
observed_PK |
a data.frame of observed PK that you would like to compare. This must include the columns "ObsValue" or "Value" for the center value for the observed data and "ObsVariability" or "Variability" for the error bars for the observed data. Some filtering this will do automatically:
|
lines_for_population_stats |
optionally include horizontal lines for the overall simulated population statistics by specifying the desired line color and type. Set this as a single text string of 1) the color for the lines (any R-friendly color specification will work), 2) the linetype for the central statistic (any R-friendly linetype will work), 3) the linetype for the variability statistic, and, optional, 4) the linewidth to use. If you omit the linewidth, we'll use a linewidth of 0.5 by default. The default of "gray80 solid dotted" will make a light gray solid line at the central statistic and a light gray dotted line at whatever you choose for the variability statistic. If you set this to "none", no lines will be included. |
color_set |
the set of colors to use. Options:
|
color_option |
How do you want to color information in the graph? Options are:
|
point_shape |
optionally specify what shape to use. To see all the
possible shapes and what number corresponds to which shape, type
|
point_size |
optionally specify what point size to use. If left as NA, the point size will be set to 3. |
bar_width |
optionally specify the error bar width. If left as NA, the error bar width will be set to 0.25. |
y_axis_limits_lin |
optionally set the Y axis limits for the linear
plot, e.g., |
legend_position |
specify where you want the legend to be. Options are "left", "right" (default), "bottom", "top", or "none" if you don't want one at all. |
include_dose_num |
TRUE or FALSE (default) on whether to include the dose number when listing the PK parameter. |
graph_title |
optionally specify a title that will be centered across your graph or set of graphs |
graph_title_size |
the font size for the graph title if it's included; default is 14. This also determines the font size of the graph labels. |
existing_exp_details |
If you have already run
|
return_caption |
TRUE or FALSE (default) for whether to return any
caption text to use with the graph. This works best if you supply something
for the argument |
prettify_compound_names |
TRUE (default), FALSE or a character vector:
This is asking whether to make compound names prettier in the figure
heading and caption. This was designed for simulations where the substrate
and any metabolites, perpetrators, or perpetrator metabolites are among the
standard options for the simulator, and leaving
|
clin_study_label_option |
Clinical study names are generally much longer than the names of the simulated trial means, which will be just "1", "2", etc., so the labels like "Clinical Study 101, fasted healthy subjects" just won't fit nicely by comparison. For this reason, you can choose how observed data study names should be automatically shortened. Options:
|
save_graph |
optionally save the output graph by supplying a file name in quotes here, e.g., "My conc time graph.png" or "My conc time graph.docx". The nice thing about saving to Word is that the figure title and caption text will be filled in automatically. If you leave off ".png" or ".docx", the graph will be saved as a png file, but if you specify a different graphical file extension, it will be saved as that file format. Acceptable graphical file extensions are "eps", "ps", "jpeg", "jpg", "tiff", "png", "bmp", or "svg". Do not include any slashes, dollar signs, or periods in the file name. Leaving this as NA means the file will not be saved to disk. |
fig_height |
figure height in inches |
fig_width |
figure width in inches |
a ggplot2 graph
# None yet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.