View source: R/plot_raincloud.R
plot_raincloud | R Documentation |
plot_raincloud
plots simple "raincloud" plots of posterior densities,
most likely for model parameters (by group).
plot_raincloud(
summary_df,
raw_df,
pars_of_interest = NULL,
type = "parameter",
test = FALSE,
by = NULL,
recode_na = 0,
par_nms = type,
par_vals = "posterior_mean",
par_lvls = NULL,
par_labs = NULL,
afct_filt = NULL,
afct_col = NULL,
combine_with = NULL,
legend_title = by,
legend_labels = NULL,
legend_pos = "right",
factor_scores = NULL,
flip = TRUE,
cred = c(0.95, 0.99),
dist_nudge = 0.1,
box_width = 0.1,
scatter = c(width = 0.15, nudge = 0.225),
pal = NULL,
font_size = 11,
font = "",
...
)
summary_df |
List of |
raw_df |
List of raw data inputs to the above fits (in the same order). Used to correctly link subject IDs to independent variables. |
pars_of_interest |
Vector of parameters to plot, for example if we want to only plot a specific parameter by a certain demographic variable. |
type |
Type of plot to return - either separate plots for each
|
test |
Boolean indicating whether summaries are from the test phase. |
by |
Separately plot distributions by a certain demographic variable? |
recode_na |
Value to recode NAs in the |
par_nms |
The name of the column that contains the discrete axis labels (i.e., the parameter or factor score names). |
par_vals |
The name of the column that contains the continuous values to plot (i.e., the parameter values or factor scores). |
par_lvls |
The order in which to plot the parameters or factors. |
par_labs |
Modify the labels of the parameters or factors - must be in
the same order as |
afct_filt |
Affect adjective to filter on, if |
afct_col |
Column containing the affect types. |
combine_with |
A column to combine with the |
legend_title , legend_labels , legend_pos |
Controls to name and label the
items in the legend (as these may be formatted poorly if |
factor_scores |
|
flip |
Boolean indicating if the axes should be flipped. |
cred |
Vector, length 2, which defines the % HDI covered by the boxplot boxes and lines respectively. |
dist_nudge |
Controls the position of the distribution plots in the x-direction. |
box_width |
Control the total width of the boxplot(s). |
scatter |
Either a named vector of scatterplot width, and nudge. Use
|
pal , font_size , font |
Same as |
... |
Additional arguments such as |
A ggplot.
## Not run:
data(example_data)
fit_nd <- fit_learning_model(
example_data$nd,
model = "2a",
vb = FALSE,
exp_part = "training"
)
fit_dis <- fit_learning_model(
example_data$dis,
model = "2a",
vb = FALSE,
exp_part = "training"
)
plot_raincloud(
summary_df = list(fit_nd$summary, fit_dis$summary),
raw_df = list(fit_nd$raw_df, fit_dis$raw_df),
by = "distanced",
flip = FALSE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.