|
1 |
| -#' Helper functions that generate dfs for tuftelines plot |
2 |
| -#' |
3 |
| -#' @noRd |
4 |
| -#' |
| 1 | +#' Generates the dataframe requires for the tufte lines plot component in raw plots. |
| 2 | +#' |
| 3 | +#' This function returns a dataframe with summary statistics, such as mean, standard |
| 4 | +#' deviation and quantiles (depending on the effect size) based on the input dataset. |
| 5 | +#' |
5 | 6 | #' @param raw_data The tidy dataset passed to [load()] that was cleaned and altered for plotting.
|
6 | 7 | #' @param enquo_x Quosure of x as initially passed to [load()].
|
7 | 8 | #' @param enquo_y Quosure of y as initially passed to [load()].
|
8 | 9 | #' @param proportional Boolean value as initially passed to [load()].
|
9 |
| -#' @param float_contrast Default TRUE. If TRUE, a Gardner-Altman plot will be produced. |
10 |
| -#' If FALSE, a Cumming estimation plot will be produced. |
11 |
| -#' @param enquo_id_col Quosure of id_col as initially passed to [load()]. |
12 |
| -#' @param idx The list of control-test groupings as initially passed to [load()]. |
13 |
| -#' @param tufte_lines_df Dataset for the creation of tufte lines. |
14 |
| -#' @param proportional_data List of calculations related to the plotting of proportion plots. |
15 |
| -#' @param scale_factor_sig Decimal value ranging from 0 to 1 which determines the significance of the scale factor. |
16 |
| -#' @param bar_width Numeric value determining the width of the bar in the sankey diagram or proportion plots. |
17 |
| -#' @param gap Numeric value determining the space between the bars in the sankey diagram or proportion plots. |
18 |
| -#' @param sankey Boolean value determining if the flows between the bar charts will be plotted. |
19 |
| -#' @param flow Boolean value determining whether the bars will be plotted in pairs. |
20 |
| -#' @param N The number of rows in the proportional dataset. |
21 |
| -#' @param proportion_success The proportion or ratio of values that are 1. |
22 |
| -#' @param boots Boot result obtained from boot.ci |
23 |
| -#' @param x_idx_position Numeric value determining the position of the plots on the x-axis. |
| 10 | +#' @param gap Integer value specifying the amount of gap for each tufte line. |
| 11 | +#' @param effsize_type String value specifying type of effect size. |
24 | 12 | #'
|
25 |
| -#' @details |
26 |
| -#' Contains functions `df_for_tufte`, `create_dfs_for_sankey`, `create_dfs_for_xaxis_redraw`, `create_dfs_for_proportion_bar` for generation of dfs. |
27 |
| -#' |
28 |
| -#' @return |
29 |
| -#' Various dfs which is required for the plotting functions to obtain a complete dabest plot. |
| 13 | +#' @returns a dataframe for plotting of the tufte lines plot component. |
| 14 | +#' @noRd |
30 | 15 | create_df_for_tufte <- function(raw_data, enquo_x, enquo_y, proportional, gap, effsize_type) {
|
31 | 16 | tufte_lines_df <- raw_data %>%
|
32 | 17 | dplyr::group_by(!!enquo_x) %>%
|
@@ -67,8 +52,19 @@ create_df_for_tufte <- function(raw_data, enquo_x, enquo_y, proportional, gap, e
|
67 | 52 |
|
68 | 53 | return(tufte_lines_df)
|
69 | 54 | }
|
70 |
| - |
71 |
| -# Function for creation of df for flow = FALSE plot |
| 55 | +#' Generates df for tufte lines plot component for raw plot WITH flow = FALSE. |
| 56 | +#' |
| 57 | +#' This function rearranges and duplicates rows in a given dataframe (containing |
| 58 | +#' summary statistics) in the order of the unlisted given list of vectors. |
| 59 | +#' |
| 60 | +#' @param idx List of vectors of control-test groupings that determines the arrangement |
| 61 | +#' of the final dataframe output. |
| 62 | +#' @param tufte_lines_df dataframe for plotting of the tufte lines plot component as |
| 63 | +#' generated by [create_df_for_tufte()]. |
| 64 | +#' @param enquo_x Quosure of x as initially passed to [load()]. |
| 65 | +#' |
| 66 | +#' @returns dataframe |
| 67 | +#' @noRd |
72 | 68 | create_dfs_for_nonflow_tufte_lines <- function(idx,
|
73 | 69 | tufte_lines_df,
|
74 | 70 | enquo_x) {
|
|
0 commit comments