plot_risk_behaviors.Rd
This function takes a dataset and produces a bar plot that visualizes the proportion of responses for different risk behavior variables in relation to suicide attempt status. It allows customization of plot titles and fill colors.
plot_risk_behaviors(
data,
behavior_vars,
suicide_var,
plot_title,
fill_colors = c("#24bccb", "#4e2d86")
)
A dataframe containing the variables of interest.
A character vector of column names in 'data' representing different risk behaviors.
The name of the column in 'data' that indicates suicide attempt status.
Title for the plot.
A character vector of length 2 providing the colors to use for the bars in the plot. Default colors are set to "#24bccb" and "#4e2d86".
A ggplot object representing the bar plot.