demog_plot | R Documentation |
demog_plot
will make a series of graphs comparing
parameters across simulated and, if provided, observed populations. All the
parameters available on the "Demographic Data" tab of a Simcyp Simulator
output Excel file are available for making comparisons, and you must obtain
the input data for making these graphs by running
extractDemog
. If you are looking at the distributions of one
parameter across populations, you can display that with either boxplots or
kernel density plots (like a smoothed histogram). If you want to compare
across simulations the relationship between pairs of parameters, scatter
plots will be used. (Only certain pairs of parameters are available; please
see notes for the argument 'demog_parameters'.)
demog_plot(
demog_dataframe,
obs_demog_dataframe = NA,
sims_to_include = "all",
demog_parameters = NA,
variability_display = "kernel density",
colorBy_column,
color_set = "default",
color_labels = NA,
legend_label_color = NA,
legend_position = "right",
graph_title = "Demographics",
alpha = 0.8,
ncol = NULL,
nrow = NULL,
facet_by_sex = TRUE,
facet_column_additional,
border_facets = TRUE,
graph_labels = TRUE,
pad_x_axis = TRUE,
pad_y_axis = TRUE,
return_indiv_graphs = FALSE,
save_graph = NA,
fig_height = 8,
fig_width = 6
)
demog_dataframe |
the output from running |
obs_demog_dataframe |
optionally supply observed demographic data for comparison. The columns you want to compare must have exactly the same names as the columns in the simulated data so that we know what's what. |
sims_to_include |
optionally specify which simulations to include. These
must be included in |
demog_parameters |
demographic parameters to include. Options:
If you want only a subset
of those, list them in a character vector, e.g., |
variability_display |
How should the variability be shown? Options are "kernel density" (default, a type of smoothed histogram) or "boxplot". Any demographic parameters requested in the form of "X vs Y", e.g., "weight vs height", will always be shown as scatter plots. |
colorBy_column |
the column in |
color_set |
the set of colors to use. Options:
|
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
|
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. Note: If you include labels on your graphs (graph_labels = TRUE), we recommend NOT putting the legend on the left or the top because the labels wind up on the outside compared to the legend, and it just looks dorky. |
graph_title |
title to use on the plots |
alpha |
how transparent to make the points, with 0 being completely transparent and invisible so I don't know why you'd want that but, hey, you do you, to 1, which is fully opaque. |
ncol |
optionally specify the number of columns. If left as NULL, a reasonable guess will be used. |
nrow |
optionally specify the number of rows. If left as NULL, a reasonable guess will be used. |
facet_by_sex |
TRUE or FALSE (default) for whether to break up the graphs into facets based on the sex of the subjects |
facet_column_additional |
optionally specify an additional column to
facet the graphs by horizontally. If |
border_facets |
TRUE (default) or FALSE for whether to include a border around the facets if the graphs are broken up by the sex of the subjects |
graph_labels |
TRUE or FALSE for whether to include labels (A, B, C, etc.) for each of the small graphs. |
pad_x_axis |
optionally add a smidge of padding to the 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
x axis. 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
|
return_indiv_graphs |
TRUE or FALSE (default) for whether to return a list of each of the individual graphs |
save_graph |
optionally save the output graph by supplying a file name in quotes here, e.g., "Demographics comparisons.png". 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 8 |
fig_width |
figure width in inches; default is 6 |
a set of ggplot2 graphs
# none yet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.