rc_plot | R Documentation |
Creates a grid of plots for each variable in long format
data. This function is intended to have data passed from rc_outliers
,
plotting the record_id field on the x-axis and values on the y-axis.
Outliers are colored in red and horizontal indicator lines for +/- 3
standard deviations are included by default. Aside from the standard
plots, normal QQ and histograms can also be created using plot_type
.
rc_plot(
long_data,
title = NULL,
plot_type = c("standard", "qq", "hist"),
outlier_var = NA,
wrap_var = "variable",
y = "value",
x = getOption("redcap_bundle")$id_field,
legend_position = "none",
sd_guides = TRUE
)
long_data |
Dataframe. A long format data frame, as created by
|
title |
Character. Title of the resulting plot. |
plot_type |
Character. One of 'standard', 'qq', or 'hist' |
outlier_var |
Character. Name of the column containing logical (T/F) data indicating which values are outliers. |
wrap_var |
Character. Name of the column containing variable names. |
y |
Character. Name of the column containing numeric data to be plotted. |
x |
Character. Field name corresponding to the 'record_id' field. |
legend_position |
Character. Determines the position of the plot legend. One of 'none', 'top', 'bottom', 'left' or 'right'. |
sd_guides |
Logical. Determines if standard deviation lines are
applied to plots. Only applies to |
Marcus Lehr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.