ct_plot3 | R Documentation |
Conveniently group three concentration-time plots of multiple-dose regimen data together:
the full time range across the top,
the first dose in the lower left quadrant, and
the last dose in the lower right quadrant.
This uses either ct_plot
or
ct_plot_overlay
behind the scenes to make the graphs, so most
of the options available for those functions will work here.
ct_plot3(
ct_dataframe,
overlay = FALSE,
figure_type = "means only",
mean_type = "arithmetic",
linear_or_log = "semi-log",
graph_title_U = "Full time range",
x_axis_interval_U = NA,
graph_title_LL = "First dose",
time_range_LL = "first dose",
x_axis_interval_LL = NA,
graph_title_LR = "Last dose",
time_range_LR = "last dose",
x_axis_interval_LR = NA,
legend_position = "none",
legend_orientation = NA,
graph_labels = TRUE,
conc_units_to_use = NA,
hline_position = NA,
hline_style = "red dotted",
vline_position = NA,
vline_style = "red dotted",
qc_graph = FALSE,
existing_exp_details = NA,
prettify_compound_names = TRUE,
name_clinical_study = NA,
return_caption = FALSE,
save_graph = NA,
fig_height = 6,
fig_width = 5,
...
)
ct_dataframe |
the input concentration-time data generated by running
either the function |
overlay |
TRUE or FALSE for whether to make overlaid graphs, i.e.,
whether to use |
figure_type |
type of figure to plot. Options are:
|
mean_type |
graph "arithmetic" (default) or "geometric" means or "median" for median concentrations. If that option was not included in the output, you'll get a warning and the graph will include one that was. |
linear_or_log |
the type of graph to be returned. Options:
|
graph_title_U |
graph title for the upper, full-time-range graph; defaults to "Full time range" |
x_axis_interval_U |
optionally set the upper graph x-axis major tick-mark interval. Acceptable input: any number or leave as NA to accept default values, which are generally reasonable guesses as to aesthetically pleasing and PK-relevant intervals. |
graph_title_LL |
graph title for the lower left graph; defaults to "First dose" |
time_range_LL |
time range to use for the lower-left graph; defaults to
"first dose" but any option acceptable for |
x_axis_interval_LL |
optionally set the lower left graph x-axis major tick-mark interval. Acceptable input: any number or leave as NA to accept default values, which are generally reasonable guesses as to aesthetically pleasing and PK-relevant intervals. |
graph_title_LR |
graph title for the lower right graph; defaults to "Last dose" |
time_range_LR |
time range to use for the lower-right graph; defaults to
"first dose" but any option acceptable for |
x_axis_interval_LR |
optionally set the lower right graph x-axis major tick-mark interval. Acceptable input: any number or leave as NA to accept default values, which are generally reasonable guesses as to aesthetically pleasing and PK-relevant intervals. |
legend_position |
Specify where you want the legend to be. Options are "left", "right", "bottom", "top", or "none" (default) if you don't want one at all. If you include the legend but then some graphs do have a legend and some graphs do not (e.g., some have perpetrators and some do not so there's nothing to put in a legend), the alignment between sets of graphs will be a bit off. |
legend_orientation |
optionally specify how the legend entries should be oriented. Options are "vertical" or "horizontal", and, if left as NA, the legend entries will be "vertical" when the legend is on the left or right and "horizontal" when it's on the top or bottom. |
graph_labels |
TRUE (default) or FALSE for whether to include labels (A, B, C) for each of the small graphs. |
conc_units_to_use |
concentration units to use for graphs. If left as
NA, the concentration units in the source data will be used. Acceptable
options are "mg/L", "mg/mL", "µg/L" (or "ug/L"), "µg/mL" (or "ug/mL"),
"ng/L", "ng/mL", "µM" (or "uM"), or "nM". If you want to use a molar
concentration and your source data were in mass per volume units or vice
versa, you'll need to provide something for the argument
|
hline_position |
numerical position(s) of any horizontal lines to add to
the graph. The default is NA to have no lines, and good syntax if you
do want lines would be, for example, |
hline_style |
the line color and type to use for any horizontal lines
that you add to the graph with |
vline_position |
numerical position(s) of any vertical lines to add to
the graph. The default is NA to have no lines, and good syntax if you
do want lines would be, for example, |
vline_style |
the line color and type to use for any vertical lines that
you add to the graph with |
qc_graph |
TRUE or FALSE (default) on whether to create a second copy of
the graph where the left panel shows the original graph and the right panel
shows information about the simulation trial design. This works MUCH faster
when you have already used |
existing_exp_details |
output from |
prettify_compound_names |
TRUE (default), FALSE or a character vector:
This is asking whether to make compound names prettier in legend entries
and in any Word output files. 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
|
name_clinical_study |
optionally specify the name(s) of the clinical
study or studies for any observed data. This only affects the caption of
the graph. For example, specifying |
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 |
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". If you leave off ".png" or ".docx" from the file name, it 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; default is 6 |
fig_width |
figure width in inches; default is 5 |
... |
arguments that pass through to |
a set of 3 arranged ggplot2 graphs
# We'll use the objects LMVct and MDZ_Keto for these examples. They're
# included in the package.
# Examples with a single compound, tissue, and simulation ----------------------
# These are all graphs where, if you made one of the panels on its own, you
# would use the function ct_plot.
# Simplest option:
ct_plot3(ct_dataframe = LMVct)
# Change the 3 graph titles
ct_plot3(ct_dataframe = LMVct,
graph_title_U = "Full time range for letermovir",
graph_title_LL = "Dose 1 of letermovir",
graph_title_LR = "Dose 8 of letermovir")
# Tweak the time intervals for the bottom row graphs
ct_plot3(ct_dataframe = LMVct,
graph_title_LL = "Dose 1 & 2",
time_range_LL = "doses 1 to 2",
graph_title_LR = "Dose 7 & 8",
time_range_LR = "doses 7 to 8")
# Make any other adjustments that you would typically make with ct_plot.
# Examples with multiple compounds, tissues, and/or simulations overlaid -------
# These are all graphs where, if you made one of the panels on its own, you
# would use the function ct_plot_overlay.
ct_plot3(ct_dataframe = MDZ_Keto %>%
filter(CompoundID == "substrate" &
Tissue == "plasma"),
overlay = TRUE, colorBy_column = Inhibitor)
# Make any other adjustments that you would typically make with ct_plot_overlay.
# This option might be a bit much! But at least it shows how it would be
# done. :)
ct_plot3(ct_dataframe = MDZ_Keto,
overlay = TRUE,
colorBy_column = Inhibitor,
facet1_column = Tissue,
facet2_column = Compound)
# You can adjust the graph titles and time ranges the same way as with a single
# simulation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.