View source: R/dissolution_profile_plot.R
dissolution_profile_plot | R Documentation |
dissolution_profile_plot
is meant to be used in conjunction with
extractExpDetails
to create graphs with dissolution-profile data,
possibly for multiple simulations or for multiple compounds.
dissolution_profile_plot(
existing_exp_details,
figure_type = "percentile ribbon",
linear_or_log = "linear",
colorBy_column,
color_labels = NA,
legend_label_color = NA,
color_set = "default",
include_errorbars = FALSE,
errorbar_width = 0.5,
linetype_column,
linetype_labels = NA,
linetypes = c("solid", "dashed"),
line_width = NA,
line_transparency = NA,
legend_label_linetype = NA,
facet1_column,
facet2_column,
facet_ncol = NA,
facet_nrow = NA,
floating_facet_scale = FALSE,
facet_spacing = NA,
time_range = NA,
x_axis_interval = NA,
x_axis_label = NA,
pad_x_axis = TRUE,
pad_y_axis = TRUE,
y_axis_limits_lin = NA,
y_axis_limits_log = NA,
y_axis_interval = NA,
y_axis_label = "Percent dissolved",
hline_position = NA,
hline_style = "red dotted",
vline_position = NA,
vline_style = "red dotted",
graph_labels = TRUE,
graph_title = NA,
graph_title_size = 14,
legend_position = NA,
prettify_compound_names = TRUE,
qc_graph = FALSE,
save_graph = NA,
fig_height = 6,
fig_width = 5
)
existing_exp_details |
output from |
figure_type |
the type of figure to plot.
|
linear_or_log |
the type of graph to be returned. Options:
|
colorBy_column |
(optional) the column in
|
color_labels |
optionally specify a character vector for how you'd like
the labels for whatever you choose for |
legend_label_color |
optionally indicate on the legend something
explanatory about what the colors represent. For example, if
|
color_set |
the set of colors to use. Options:
|
include_errorbars |
TRUE or FALSE (default) for whether to include error bars for the standard deviation. |
errorbar_width |
width of error bars to use in hours (or, if you've used some other time unit, in whatever units are in your data). Default is 0.5. |
linetype_column |
the column in
|
linetype_labels |
optionally specify a character vector for how you'd
like the labels for whatever you choose for |
linetypes |
the line types to use. Default is "solid" for all lines.
You'll need one line type for each possible value in the column you
specified for |
line_width |
optionally specify how thick to make the lines. Acceptable input is a number; the default is 1 for most lines and 0.8 for some, to give you an idea of where to start. |
legend_label_linetype |
optionally indicate on the legend something
explanatory about what the line types represent. For example, if
|
facet1_column |
optionally break up the graph into small multiples; this
specifies the first of up to two columns to break up the data by, and the
designated column name should be unquoted, e.g., |
facet2_column |
optionally break up the graph into small multiples; this
specifies the second of up to two columns to break up the data by, and the
designated column name should be unquoted, e.g., |
facet_ncol |
optionally specify the number of columns of facetted graphs
you would like to have. This only applies when you have specified a column
for |
facet_nrow |
optionally specify the number of rows of facetted graphs
you would like to have. This only applies when you have specified a column
for |
floating_facet_scale |
TRUE or FALSE (default) for whether to allow the axes for each facet of a multi-facetted graph to scale freely to best fit whatever data are present. Default is FALSE, which means that all data will be on the same scale for easy comparison. However, this could mean that some graphs have lines that are hard to see, so you can set this to TRUE to allow the axes to shrink or expand according to what data are present for that facet. Floating axes comes with a trade-off for the looks of the graphs, though: Setting this to TRUE does mean that your x axis won't automatically have pretty breaks that are sensible for times in hours. |
facet_spacing |
Optionally set the spacing between facets. If left as
NA, a best-guess as to a reasonable amount of space will be used. Units are
"lines", so try, e.g. |
time_range |
time range to display. Options:
|
x_axis_interval |
set the 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. |
x_axis_label |
optionally supply a character vector or an expression to use for the x axis label |
pad_x_axis |
optionally add a smidge of padding to the x axis (default
is TRUE, which includes some generally reasonable padding). If changed to
FALSE, the y axis will be placed right at the beginning of your time range
and all data will end exactly at the end of the time range
specified. If you want a specific amount of x-axis padding, set this
to a number; the default is |
pad_y_axis |
optionally add a smidge of padding to the y axis (default
is TRUE, which includes some generally reasonable padding). As with
|
y_axis_limits_lin |
Optionally set the Y axis limits for the linear
plot, e.g., |
y_axis_limits_log |
Optionally set the Y axis limits for the semi-log
plot, e.g., |
y_axis_interval |
set the y-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 intervals. |
y_axis_label |
optionally supply a character vector or an expression to use for the y axis label |
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 |
graph_labels |
TRUE or FALSE for whether to include labels (A, B, C, etc.) for each of the small graphs. (Not applicable if only outputting linear or only semi-log graphs.) |
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. |
legend_position |
Specify where you want the legend to be. Options are "left", "right" (default in most scenarios), "bottom", "top", or "none" if you don't want one at all. |
prettify_compound_names |
set this to a) TRUE (default) or FALSE for
whether to make the compound names in the legend prettier or b) supply a
named character vector to set it to the exact name you'd prefer to see in
your legend. For example, |
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 partly filled in automatically, although you should check that the text makes sense in light of your exact graph. If you leave off ".png" or ".docx", 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 automatically saved to disk. |
fig_height |
figure height in inches; default is 6 |
fig_width |
figure width in inches; default is 5 |
a ggplot2 graphs or a set of arranged ggplot2 graphs
Details <- extractExpDetails_mult(sim_data_files = NA)
dissolution_profile_plot(existing_exp_details = Details)
# If you have multiple simulations or multiple compounds and you only
# want to graph one, here is an example of how to filter your data to do
# that.
Details_subset <- Details
Details_subset$DissolutionProfiles <- Details_subset$DissolutionProfiles %>%
filter(CompoundID == "substrate" &
File == "simulation A.xlsx")
dissolution_profile_plot(existing_exp_details = Details_subset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.